Skip to content

clojure-mode v5.24.0

Latest

Choose a tag to compare

@github-actions github-actions released this 07 Nov 10:03

New features

  • #708: Add clojure-remove-unused-keys (C-c C-r k), which removes the names the top-level form at point destructures from maps but never uses, along with their :or defaults.

Changes

  • #705: Rename the #_ toggle commands to clojure-toggle-discard, clojure-toggle-discard-surrounding-form and clojure-toggle-discard-defun, matching Clojure's "discard" terminology (the old clojure-toggle-ignore* names remain as obsolete aliases).
  • #709: Give extend-protocol, extend-type, specify and specify! the ((:block 1) (:inner 1)) indent spec that clojure-ts-mode and cljfmt use, instead of an (:inner 0) rule that only worked because of how it was converted to the legacy format (specs copied from it need (:inner 1) too).
  • #709: Indent fdef like cljfmt does, as ((:inner 0)), and list let* in the built-in indent specs, so that clojure-get-indent-spec returns its spec.
  • #709: Add the indent specs that cljfmt and clojure-ts-mode have and clojure-mode lacked, which indents the bodies of match and struct-map, and the bindings of with-open, with-redefs and the like as special arguments.
  • #710: Drop the indent specs of async, this-as and core.logic's run, run* and fresh, which cljfmt and clojure-ts-mode don't have, so they're indented like function calls now (put-clojure-indent brings them back).

Bugs fixed

  • #709: Fix clojure-get-indent-spec and put-clojure-indent converting legacy indent specs, like those of letfn, reify or extend-protocol, to the wrong modern rules.
  • #709: Fix indenting with a modern indent spec that has an :inner rule with a position but no :block rule, like ((:inner 1 0)), which signaled an error.
  • #711: Fix the indentation of letfn functions, and of other forms an :inner rule with an index applies to, when a #_ form comes before them, as the discarded form and its #_ counted as two arguments.
  • #707: Highlight [[var]] and `code` only in strings and comments, so Datalog relation bindings like [[?x]] and destructuring like (fn [[x]] x) aren't colored as constants in code.