branch: elpa/clojure-mode
commit 331db3f468f3e1d9b7ef807b87ca7823d7b866d0
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Use char-after instead of buffer-substring in toggle-keyword-string
Replace verbose buffer-substring-no-properties single-char comparisons
with direct char-after calls, and use = instead of equal for the
numeric point comparison.
---
clojure-mode.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/clojure-mode.el b/clojure-mode.el
index c74cdabd56..341a68c2f0 100644
--- a/clojure-mode.el
+++ b/clojure-mode.el
@@ -2005,15 +2005,15 @@ nil."
(interactive)
(let ((original-point (point)))
(while (and (> (point) 1)
- (not (equal "\"" (buffer-substring-no-properties (point) (+ 1
(point)))))
- (not (equal ":" (buffer-substring-no-properties (point) (+ 1
(point))))))
+ (not (eq ?\" (char-after)))
+ (not (eq ?: (char-after))))
(backward-char))
(cond
- ((equal 1 (point))
+ ((= 1 (point))
(error "Beginning of file reached, this was probably a mistake"))
- ((equal "\"" (buffer-substring-no-properties (point) (+ 1 (point))))
+ ((eq ?\" (char-after))
(insert ":" (substring (clojure-delete-and-extract-sexp) 1 -1)))
- ((equal ":" (buffer-substring-no-properties (point) (+ 1 (point))))
+ ((eq ?: (char-after))
(insert "\"" (substring (clojure-delete-and-extract-sexp) 1) "\"")))
(goto-char original-point)))