Skip to content

Commit 74550a9

Browse files
committed
Fix clojure-sort-ns with comments in the end
- closes clojure-emacs#645
1 parent 3453cd2 commit 74550a9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clojure-mode.el

+7-1
Original file line numberDiff line numberDiff line change
@@ -2029,7 +2029,13 @@ content) are considered part of the preceding sexp."
20292029
(save-restriction
20302030
(narrow-to-region (point) (save-excursion
20312031
(up-list)
2032-
(1- (point))))
2032+
;; Ignore any comments in the end before sorting
2033+
(backward-char)
2034+
(forward-sexp -1)
2035+
(clojure-forward-logical-sexp)
2036+
(unless (looking-at-p ")")
2037+
(search-forward-regexp "$"))
2038+
(point)))
20332039
(skip-chars-forward "\r\n[:blank:]")
20342040
(sort-subr nil
20352041
(lambda () (skip-chars-forward "\r\n[:blank:]"))

0 commit comments

Comments
 (0)