Skip to content

Commit eb8ad00

Browse files
author
Greg Hendershott
committed
Rename racket-rackjure-indent to racket-indent-curly-as-sequence.
Also improve doc strings and comments.
1 parent 107e8ea commit eb8ad00

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

example/example.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;; -*- racket-indent-sequence-depth: 100; racket-rackjure-indent: t; -*-
1+
;; -*- racket-indent-sequence-depth: 100; racket-indent-curly-as-sequence: t; -*-
22

33
#lang racket
44

example/indent.rkt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
;; -*- racket-indent-sequence-depth: 100; racket-rackjure-indent: t; -*-
1+
;; -*- racket-indent-sequence-depth: 100; racket-indent-curly-as-sequence: t; -*-
22

33
;;; Quoted list
44

@@ -44,7 +44,7 @@
4444
#'(foo (#%app hasheq (quote a) (quote 42))
4545
(quote a))
4646

47-
;;; Rackjure style dictionary
47+
;;; Rackjure style dictionary (when racket-indent-curly-as-sequence is t).
4848

4949
{a b
5050
c d}

racket-custom.el

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,23 @@ Defaults to a regexp ignoring all inputs of 0, 1, or 2 letters."
120120
:tag "Other"
121121
:group 'racket)
122122

123+
(defcustom racket-indent-curly-as-sequence t
124+
"Indent {} with items aligned with the head item?
125+
This is indirectly disabled if `racket-indent-sequence-depth' is 0.
126+
This is safe to set as a file-local variable."
127+
:tag "Indent Curly As Sequence"
128+
:type 'boolean
129+
:safe #'booleanp
130+
:group 'racket-other)
131+
123132
(defcustom racket-indent-sequence-depth 0
124133
"To what depth should `racket--align-sequence-to-head' search.
125134
This affects the indentation of forms like '() `() #() -- and {}
126-
if `racket-rackjure-indent' is t -- but not #'() #`() ,() ,@(). A
127-
zero value disables, giving the normal indent behavior of
128-
DrRacket or Emacs `lisp-mode' derived modes like `scheme-mode'.
129-
Note that setting this to a high value can make indentation
130-
noticeably slower."
135+
if `racket-indent-curly-as-sequence' is t -- but not #'() #`()
136+
,() ,@(). A zero value disables, giving the normal indent
137+
behavior of DrRacket or Emacs `lisp-mode' derived modes like
138+
`scheme-mode'. Setting this to a high value can make indentation
139+
noticeably slower. This is safe to set as a file-local variable."
131140
:tag "Indent Sequence Depth"
132141
:type 'integerp
133142
:safe #'integerp
@@ -141,14 +150,6 @@ Instead you can insert actual λ characters using \\<racket-mode-map>\\[racket-i
141150
:safe #'booleanp
142151
:group 'racket-other)
143152

144-
(defcustom racket-rackjure-indent t
145-
"Indent {} with items aligned with the head item?
146-
This is indirectly disabled if `racket-indent-sequence-depth' is 0."
147-
:tag "Rackjure Indent"
148-
:type 'boolean
149-
:safe #'booleanp
150-
:group 'racket-other)
151-
152153
(defcustom racket-smart-open-bracket-enable nil
153154
"Use `racket-smart-open-bracket' when '[' is pressed?"
154155
:tag "Smart Open Bracket Enable"

racket-indent.el

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Lisp function does not specify a special indentation."
147147
(defun racket--align-sequence-with-head ()
148148
"Indent items with the head item for certain sequences?
149149
150-
These include '() `() #() -- and {} if `racket-rackjure-indent'
150+
These include '() `() #() -- and {} if `racket-indent-curly-as-sequence'
151151
is t -- but not #'() #`() ,() ,@().
152152
153153
To handle nested items, search `backward-up-list' up to
@@ -170,8 +170,8 @@ To handle nested items, search `backward-up-list' up to
170170
;; a vector literal: #( )
171171
(and (eq (char-before (point)) ?#)
172172
(eq (char-after (point)) ?\())
173-
;; #lang rackjure dict literal { ... }
174-
(and racket-rackjure-indent
173+
;; { }
174+
(and racket-indent-curly-as-sequence
175175
(eq (char-after (point)) ?{)))
176176
(setq answer t))
177177
(;; unquote or unquote-splicing

0 commit comments

Comments
 (0)