branch: elpa/clojure-mode
commit f44ea50308b1afe913b75dfc18e6280e52fd21b4
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Use syntax-ppss instead of parse-partial-sexp in protocol docstring
detection
parse-partial-sexp from point-min rescans the entire buffer each time,
while syntax-ppss uses internal caches making it O(1) amortized during
font-lock.
---
clojure-mode.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/clojure-mode.el b/clojure-mode.el
index 1a6477f002..8640cf3cd0 100644
--- a/clojure-mode.el
+++ b/clojure-mode.el
@@ -1274,8 +1274,7 @@ highlighted region)."
(skip-chars-forward " \t\n\r")
(eq (char-after) ?\)))
(save-excursion
- (let ((parent-beg (nth 1 (parse-partial-sexp
- (point-min) listbeg))))
+ (let ((parent-beg (nth 1 (syntax-ppss listbeg))))
(and parent-beg
(goto-char parent-beg)
(looking-at "([ \t\n]*defprotocol\\>"))))))