summaryrefslogtreecommitdiff
path: root/cape.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2024-01-31 00:01:20 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2024-01-31 00:01:20 +0100
commitbfde79ed440343c0dbf0f64cfe7913c1efbe3f83 (patch)
tree014f7befd185a152cea48bed5e141c770188e5a1 /cape.el
parent597fe6938c832238e97e92a5b7392bba25e0e827 (diff)
Improve cape-wrap-inside-code
Diffstat (limited to 'cape.el')
-rw-r--r--cape.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/cape.el b/cape.el
index ea7277a..011be84 100644
--- a/cape.el
+++ b/cape.el
@@ -1119,7 +1119,8 @@ This function can be used as an advice around an existing Capf."
(defun cape-wrap-inside-code (capf)
"Call CAPF only if inside code, not inside a comment or string.
This function can be used as an advice around an existing Capf."
- (and (not (or (nth 3 (syntax-ppss)) (nth 4 (syntax-ppss)))) (funcall capf)))
+ (let ((s (syntax-ppss)))
+ (and (not (nth 3 s)) (not (nth 4 s)) (funcall capf))))
;;;###autoload
(defun cape-wrap-inside-comment (capf)