Skip to content

Commit f13aa84

Browse files
committed
Avoid duplicate syntax-ppss call in clojure-string-start
1 parent 61421db commit f13aa84

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

clojure-mode.el

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,12 +1990,13 @@ work). To set it from Lisp code, use
19901990
If REGEX is non-nil, return the position of the # that begins the
19911991
regex at point. If point is not inside a string or regex, return
19921992
nil."
1993-
(when (nth 3 (syntax-ppss)) ;; Are we really in a string?
1994-
(let* ((beg (nth 8 (syntax-ppss)))
1995-
(hash (eq ?# (char-before beg))))
1996-
(if regex
1997-
(and hash (1- beg))
1998-
(and (not hash) beg)))))
1993+
(let ((ppss (syntax-ppss)))
1994+
(when (nth 3 ppss) ;; Are we really in a string?
1995+
(let* ((beg (nth 8 ppss))
1996+
(hash (eq ?# (char-before beg))))
1997+
(if regex
1998+
(and hash (1- beg))
1999+
(and (not hash) beg))))))
19992000

20002001
(defun clojure-char-at-point ()
20012002
"Return the char at point or nil if at buffer end."

0 commit comments

Comments
 (0)