[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape bfde79ed44 2/2: Improve cape-wrap-inside-code
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape bfde79ed44 2/2: Improve cape-wrap-inside-code |
Date: |
Tue, 30 Jan 2024 18:57:35 -0500 (EST) |
branch: externals/cape
commit bfde79ed440343c0dbf0f64cfe7913c1efbe3f83
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Improve cape-wrap-inside-code
---
cape.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/cape.el b/cape.el
index ea7277a37f..011be84aa0 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)