branch: elpa/clojure-mode
commit 0399fb70f37cf86d8a984b7d04679e543e6376db
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Move comment-normalize-vars call from hot loop to mode setup
    
    clojure--looking-at-non-logical-sexp called comment-normalize-vars
    on every invocation, but this function is called from
    clojure-forward/backward-logical-sexp which run in tight loops
    during indentation, alignment, and navigation. Since the comment
    variables are set up once in clojure-mode-variables and don't
    change, calling comment-normalize-vars once during mode
    initialization is sufficient.
---
 clojure-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clojure-mode.el b/clojure-mode.el
index 30de27716a..7db2094d10 100644
--- a/clojure-mode.el
+++ b/clojure-mode.el
@@ -639,7 +639,8 @@ replacement for `cljr-expand-let`."
   (setq-local prettify-symbols-alist clojure--prettify-symbols-alist)
   (setq-local open-paren-in-column-0-is-defun-start nil)
   (setq-local add-log-current-defun-function #'clojure-current-defun-name)
-  (setq-local beginning-of-defun-function 
#'clojure-beginning-of-defun-function))
+  (setq-local beginning-of-defun-function 
#'clojure-beginning-of-defun-function)
+  (comment-normalize-vars))
 
 (defsubst clojure-in-docstring-p ()
   "Check whether point is in a docstring."
@@ -2279,7 +2280,6 @@ Returns a list pair, e.g. (\"defn\" \"abc\") or 
(\"deftest\" \"some-test\")."
 (defun clojure--looking-at-non-logical-sexp ()
   "Return non-nil if text after point is \"non-logical\" sexp.
 \"Non-logical\" sexp are ^metadata and #reader.macros."
-  (comment-normalize-vars t) ;; `t`: avoid prompts
   (comment-forward (point-max))
   (looking-at-p "\\(?:#?\\^\\)\\|#:?:?[[:alpha:]]"))
 

Reply via email to