Skip to content

Treat , as a non-logical sexpr character #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ Returns a list pair, e.g. (\"defn\" \"abc\") or (\"deftest\" \"some-test\")."
Sexps that don't represent code are ^metadata or #reader.macros."
(comment-normalize-vars)
(comment-forward (point-max))
(looking-at-p "\\^\\|#[?[:alpha:]]"))
(looking-at-p "\\^\\|#[?[:alpha:]]\\|,"))

(defun clojure-forward-logical-sexp (&optional n)
"Move forward N logical sexps.
Expand All @@ -1465,6 +1465,7 @@ This will skip over sexps that don't represent objects, so that ^hints and
(while (> n 0)
(while (clojure--looking-at-non-logical-sexp)
(forward-sexp 1))
(skip-chars-forward ",")
;; The actual sexp
(forward-sexp 1)
(setq n (1- n))))))
Expand Down
6 changes: 6 additions & 0 deletions test/clojure-mode-indentation-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ x
:b {:a :a
:aa :a}}")

(def-full-align-test trailing-commas
"{:a {:a :a,
:aa :a},
:b {:a :a,
:aa :a}}")


;;; Misc

Expand Down