branch: elpa/clojure-mode
commit f13aa847e13d5d5a63a0647b2dba7eb24c8061a1
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Avoid duplicate syntax-ppss call in clojure-string-start
---
clojure-mode.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/clojure-mode.el b/clojure-mode.el
index 87ba8a2e84..ecef507a92 100644
--- a/clojure-mode.el
+++ b/clojure-mode.el
@@ -1990,12 +1990,13 @@ work). To set it from Lisp code, use
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?
- (let* ((beg (nth 8 (syntax-ppss)))
- (hash (eq ?# (char-before beg))))
- (if regex
- (and hash (1- beg))
- (and (not hash) beg)))))
+ (let ((ppss (syntax-ppss)))
+ (when (nth 3 ppss) ;; Are we really in a string?
+ (let* ((beg (nth 8 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."