From d38bdf41b1d5334f944c2fcf719153f2b66eb647 Mon Sep 17 00:00:00 2001 From: yuhan0 Date: Tue, 6 Apr 2021 22:55:38 +0800 Subject: [PATCH 1/2] Simplify clojure-string-start --- clojure-mode.el | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/clojure-mode.el b/clojure-mode.el index ba17bf6b..6579d394 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -1662,17 +1662,11 @@ If REGEX is non-nil, return the position of the # that begins the regex at point. If point is not inside a string or regex, return nil." (when (nth 3 (syntax-ppss)) ;; Are we really in a string? - (save-excursion - (save-match-data - ;; Find a quote that appears immediately after whitespace, - ;; beginning of line, hash, or an open paren, brace, or bracket - (re-search-backward "\\(\\s-\\|^\\|#\\|(\\|\\[\\|{\\)\\(\"\\)") - (let ((beg (match-beginning 2))) - (when beg - (if regex - (and (char-before beg) (eq ?# (char-before beg)) (1- beg)) - (when (not (eq ?# (char-before beg))) - beg)))))))) + (let* ((beg (nth 8 (syntax-ppss))) + (hash (eq ?# (char-before beg)))) + (if regex + (and hash (1- beg)) + (and (not hash) beg))))) (defun clojure-char-at-point () "Return the char at point or nil if at buffer end." From adf3c5412361e712985aac726f47f73c6a12df6b Mon Sep 17 00:00:00 2001 From: yuhan0 Date: Sun, 2 May 2021 16:00:33 +0800 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1458ceee..056a5d91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Changes +* [#589](https://github.com/clojure-emacs/clojure-mode/issues/589): Improve font-locking performance on strings with escaped characters. * [#571](https://github.com/clojure-emacs/clojure-mode/issues/571): Remove `project.el` integration. * [#574](https://github.com/clojure-emacs/clojure-mode/issues/574): Remove `clojure-view-grimoire` command. * Stop `clojure-sort-ns` from calling `redisplay`.