Skip to content

Commit 53ef8ac

Browse files
authored
Remove calls to redisplay from clojure-sort-ns (#579)
This avoids unwanted flicker when jumping from current location to ns form and back. Especially useful when `clojure-sort-ns` is called from `before-save-hook`, and would otherwise distract the user.
1 parent 9599ae2 commit 53ef8ac

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
* [#571](https://github.com/clojure-emacs/clojure-mode/issues/571): Remove `project.el` integration.
88
* [#574](https://github.com/clojure-emacs/clojure-mode/issues/574): Remove `clojure-view-grimoire` command.
9+
* Stop `clojure-sort-ns` from calling `redisplay`
910

1011
## 5.12.0 (2020-08-13)
1112

clojure-mode.el

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,6 @@ content) are considered part of the preceding sexp."
18271827
(if (clojure-find-ns)
18281828
(save-excursion
18291829
(goto-char (match-beginning 0))
1830-
(redisplay)
18311830
(let ((beg (point))
18321831
(ns))
18331832
(forward-sexp 1)
@@ -1842,10 +1841,7 @@ content) are considered part of the preceding sexp."
18421841
(goto-char beg)
18431842
(if (looking-at (regexp-quote ns))
18441843
(message "ns form is already sorted")
1845-
(sleep-for 0.1)
1846-
(redisplay)
1847-
(message "ns form has been sorted")
1848-
(sleep-for 0.1))))
1844+
(message "ns form has been sorted"))))
18491845
(user-error "Can't find ns form")))
18501846

18511847
(defconst clojure-namespace-name-regex

0 commit comments

Comments
 (0)