1010; ; Artur Malabarba <bruce.connor.am@gmail.com>
1111; ; URL: http://github.com/clojure-emacs/clojure-mode
1212; ; Keywords: languages clojure clojurescript lisp
13- ; ; Version: 5.10.0-snapshot
13+ ; ; Version: 5.10.0
1414; ; Package-Requires: ((emacs "25.1"))
1515
1616; ; This file is not part of GNU Emacs.
9494 " Face used to font-lock Clojure character literals."
9595 :package-version '(clojure-mode . " 3.0.0" ))
9696
97- (defcustom clojure-indent-style : always-align
97+ (defcustom clojure-indent-style ' always-align
9898 " Indentation style to use for function forms and macro forms.
9999There are two cases of interest configured by this variable.
100100
@@ -112,7 +112,7 @@ already use special indentation rules.
112112The possible values for this variable are keywords indicating how
113113to indent function forms.
114114
115- `: always-align' - Follow the same rules as `lisp-mode' . All
115+ `always-align' - Follow the same rules as `lisp-mode' . All
116116 args are vertically aligned with the first arg in case (A),
117117 and vertically aligned with the function name in case (B).
118118 For instance:
@@ -122,30 +122,27 @@ to indent function forms.
122122 merge
123123 some-coll)
124124
125- `: always-indent' - All args are indented like a macro body.
125+ `always-indent' - All args are indented like a macro body.
126126 (reduce merge
127127 some-coll)
128128 (reduce
129129 merge
130130 some-coll)
131131
132- `: align-arguments' - Case (A) is indented like `lisp' , and
132+ `align-arguments' - Case (A) is indented like `lisp' , and
133133 case (B) is indented like a macro body.
134134 (reduce merge
135135 some-coll)
136136 (reduce
137137 merge
138138 some-coll)"
139- :safe #'keywordp
140- :type '(choice (const :tag " Same as `lisp-mode' " : always-align )
141- (const :tag " Indent like a macro body" : always-indent )
139+ :safe #'symbolp
140+ :type '(choice (const :tag " Same as `lisp-mode' " ' always-align )
141+ (const :tag " Indent like a macro body" ' always-indent )
142142 (const :tag " Indent like a macro body unless first arg is on the same line"
143- : align-arguments ))
143+ ' align-arguments ))
144144 :package-version '(clojure-mode . " 5.2.0" ))
145145
146- (define-obsolete-variable-alias 'clojure-defun-style-default-indent
147- 'clojure-indent-style " 5.2.0" )
148-
149146(defcustom clojure-use-backtracking-indent t
150147 " When non-nil, enable context sensitive indentation."
151148 :type 'boolean
@@ -1370,6 +1367,10 @@ spec."
13701367 (let ((function (thing-at-point 'symbol )))
13711368 (clojure--get-indent-method function))))
13721369
1370+ (defun clojure--keyword-to-symbol (keyword )
1371+ " Convert KEYWORD to symbol."
1372+ (intern (substring (symbol-name keyword) 1 )))
1373+
13731374(defun clojure--normal-indent (last-sexp indent-mode )
13741375 " Return the normal indentation column for a sexp.
13751376Point should be after the open paren of the _enclosing_ sexp, and
@@ -1395,19 +1396,22 @@ accepted by `clojure-indent-style'."
13951396 ; ; Here we have reached the start of the enclosing sexp (point is now at
13961397 ; ; the function name), so the behaviour depends on INDENT-MODE and on
13971398 ; ; whether there's also an argument on this line (case A or B).
1398- (let ((case-a ; The meaning of case-a is explained in `clojure-indent-style' .
1399+ (let ((indent-mode (if (keywordp indent-mode)
1400+ ; ; needed for backwards compatibility
1401+ ; ; as before clojure-mode 5.10 indent-mode was a keyword
1402+ (clojure--keyword-to-symbol indent-mode)
1403+ indent-mode))
1404+ (case-a ; The meaning of case-a is explained in `clojure-indent-style' .
13991405 (and last-sexp-start
14001406 (< last-sexp-start (line-end-position )))))
14011407 (cond
1402- ; ; For compatibility with the old `clojure-defun-style-default-indent' , any
1403- ; ; value other than these 3 is equivalent to `always-body' .
1404- ((not (memq indent-mode '(:always-align :align-arguments nil )))
1408+ ((eq indent-mode 'always-indent )
14051409 (+ (current-column ) lisp-body-indent -1 ))
14061410 ; ; There's an arg after the function name, so align with it.
14071411 (case-a (goto-char last-sexp-start)
14081412 (current-column ))
14091413 ; ; Not same line.
1410- ((eq indent-mode : align-arguments )
1414+ ((eq indent-mode ' align-arguments )
14111415 (+ (current-column ) lisp-body-indent -1 ))
14121416 ; ; Finally, just align with the function name.
14131417 (t (current-column )))))))
@@ -1479,7 +1483,7 @@ This function also returns nil meaning don't specify the indentation."
14791483 (+ lisp-body-indent containing-form-column))
14801484 ; ; Further non-special args, align with the arg above.
14811485 ((> pos (1+ method))
1482- (clojure--normal-indent last-sexp : always-align ))
1486+ (clojure--normal-indent last-sexp ' always-align ))
14831487 ; ; Special arg. Rigidly indent with a large indentation.
14841488 (t
14851489 (+ (* 2 lisp-body-indent) containing-form-column)))))
@@ -1493,7 +1497,7 @@ This function also returns nil meaning don't specify the indentation."
14931497 (cond
14941498 ; ; Preserve useful alignment of :require (and friends) in `ns' forms.
14951499 ((and function (string-match " ^:" function))
1496- (clojure--normal-indent last-sexp : always-align ))
1500+ (clojure--normal-indent last-sexp ' always-align ))
14971501 ; ; This should be identical to the :defn above.
14981502 ((and function
14991503 (string-match " \\ `\\ (?:\\ S +/\\ )?\\ (def[a-z]*\\ |with-\\ )"
0 commit comments