Skip to content

Commit 633331f

Browse files
committed
Replace the deprecated function in-string-p
1 parent 5cf0fd9 commit 633331f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

clojure-mode.el

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,11 +2149,15 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-cycle-privacy"
21492149
(interactive)
21502150
(clojure--convert-collection "#{" "}"))
21512151

2152+
(defun clojure--in-string-p ()
2153+
"Check whether the point is currently in a string."
2154+
(nth 3 (syntax-ppss)))
2155+
21522156
(defun clojure--goto-if ()
21532157
"Find the first surrounding if or if-not expression."
2154-
(when (in-string-p)
2158+
(when (clojure--in-string-p)
21552159
(while (or (not (looking-at "("))
2156-
(in-string-p))
2160+
(clojure--in-string-p))
21572161
(backward-char)))
21582162
(while (not (looking-at "\\((if \\)\\|\\((if-not \\)"))
21592163
(condition-case nil
@@ -2183,9 +2187,9 @@ See: https://github.com/clojure-emacs/clj-refactor.el/wiki/cljr-cycle-if"
21832187
;; TODO: Remove code duplication with `clojure--goto-if'.
21842188
(defun clojure--goto-when ()
21852189
"Find the first surrounding when or when-not expression."
2186-
(when (in-string-p)
2190+
(when (clojure--in-string-p)
21872191
(while (or (not (looking-at "("))
2188-
(in-string-p))
2192+
(clojure--in-string-p))
21892193
(backward-char)))
21902194
(while (not (looking-at "\\((when \\)\\|\\((when-not \\)"))
21912195
(condition-case nil
@@ -2236,9 +2240,9 @@ bracket.")
22362240

22372241
(defun clojure--goto-let ()
22382242
"Go to the beginning of the nearest let form."
2239-
(when (in-string-p)
2243+
(when (clojure--in-string-p)
22402244
(while (or (not (looking-at "("))
2241-
(in-string-p))
2245+
(clojure--in-string-p))
22422246
(backward-char)))
22432247
(ignore-errors
22442248
(while (not (looking-at clojure--let-regexp))

0 commit comments

Comments
 (0)