Variable: clojure-indent-keyword-style

clojure-indent-keyword-style is a customizable variable defined in clojure-mode.el.

Value

always-align

Documentation

Indentation style to use for forms that start with a keyword.

For function/macro forms, see clojure-indent-style. There are two cases of interest configured by this variable.

- Case (A) is when at least one argument following the keyword is
  on the same line as the keyword.
- Case (B) is the opposite (no arguments are on the same line as
  the keyword).

The possible values for this variable are keywords indicating how to indent keyword invocation forms.

    always-align - Follow the same rules as lisp-mode. All
    args are vertically aligned with the first arg in case (A),
    and vertically aligned with the function name in case (B).
    For instance:
        (:require [foo.bar]
                  [bar.baz])
        (:require
         [foo.bar]
         [bar.baz])

    always-indent - All args are indented like a macro body.
        (:require [foo.bar]
           [bar.baz])
        (:x
           location
           0)

    align-arguments - Case (A) is indented like lisp, and
    case (B) is indented like a macro body.
        (:require [foo.bar]
                  [bar.baz])
        (:x
           location
           0)

This variable was added, or its default value changed, in clojure-mode version 5.19.0.

Source Code

;; Defined in ~/.emacs.d/elpa/clojure-mode-20260325.811/clojure-mode.el
(defcustom clojure-indent-keyword-style 'always-align
  "Indentation style to use for forms that start with a keyword.
For function/macro forms, see `clojure-indent-style'.
There are two cases of interest configured by this variable.

- Case (A) is when at least one argument following the keyword is
  on the same line as the keyword.
- Case (B) is the opposite (no arguments are on the same line as
  the keyword).

The possible values for this variable are keywords indicating how
to indent keyword invocation forms.

    `always-align' - Follow the same rules as `lisp-mode'.  All
    args are vertically aligned with the first arg in case (A),
    and vertically aligned with the function name in case (B).
    For instance:
        (:require [foo.bar]
                  [bar.baz])
        (:require
         [foo.bar]
         [bar.baz])

    `always-indent' - All args are indented like a macro body.
        (:require [foo.bar]
           [bar.baz])
        (:x
           location
           0)

    `align-arguments' - Case (A) is indented like `lisp', and
    case (B) is indented like a macro body.
        (:require [foo.bar]
                  [bar.baz])
        (:x
           location
           0)"
  :safe #'symbolp
  :type '(choice (const :tag "Same as `lisp-mode'" always-align)
                 (const :tag "Indent like a macro body" always-indent)
                 (const :tag "Indent like a macro body unless first arg is on the same line"
                        align-arguments))
  :package-version '(clojure-mode . "5.19.0"))