Skip to content

Commit

Permalink
Fix a bug in ns-sort with comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Malabarba committed May 13, 2016
1 parent c09152a commit 1b41102
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1484,13 +1484,17 @@ content) are considered part of the preceding sexp."
;; Move to start of ns name.
(lambda ()
(comment-forward)
(skip-chars-forward "[(")
(skip-chars-forward "[:blank:]\n\r[(")
(clojure-forward-logical-sexp)
(forward-sexp -1)
nil)
;; Move to end of ns name.
(lambda ()
(clojure-forward-logical-sexp)))))
(clojure-forward-logical-sexp)))
(goto-char (point-max))
;; Does the last line now end in a comment?
(when (nth 4 (parse-partial-sexp (point-min) (point)))
(insert "\n"))))

(defun clojure-sort-ns ()
"Internally sort each sexp inside the ns form."
Expand Down

0 comments on commit 1b41102

Please sign in to comment.