emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/cape 597fe6938c 1/2: Improve cape-capf-inside-code


From: ELPA Syncer
Subject: [elpa] externals/cape 597fe6938c 1/2: Improve cape-capf-inside-code
Date: Tue, 30 Jan 2024 18:57:35 -0500 (EST)

branch: externals/cape
commit 597fe6938c832238e97e92a5b7392bba25e0e827
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Improve cape-capf-inside-code
---
 README.org | 4 ++--
 cape.el    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 732f7188a9..f7ff3f36e5 100644
--- a/README.org
+++ b/README.org
@@ -255,8 +255,8 @@ the Capf transformers with =defalias= to a function symbol.
 - ~cape-capf-accept-all~, ~cape-wrap-accept-all~: Create a Capf which accepts 
every input as valid.
 - ~cape-capf-case-fold~, ~cape-wrap-case-fold~: Create a Capf which is case 
insensitive.
 - ~cape-capf-debug~, ~cape-wrap-debug~: Create a Capf which prints debugging 
messages.
-- ~cape-capf-inside-code~, ~cape-wrap-inside-code~: Ensure that Capf triggers 
only inside code (not comments).
-- ~cape-capf-inside-comment~, ~cape-wrap-inside-comment~: Ensure that Capf 
triggers only inside comment.
+- ~cape-capf-inside-code~, ~cape-wrap-inside-code~: Ensure that Capf triggers 
only inside code.
+- ~cape-capf-inside-comment~, ~cape-wrap-inside-comment~: Ensure that Capf 
triggers only inside comments.
 - ~cape-capf-inside-faces~, ~cape-wrap-inside-faces~: Ensure that Capf 
triggers only inside text with certain faces.
 - ~cape-capf-inside-string~, ~cape-wrap-inside-string~: Ensure that Capf 
triggers only inside a string literal.
 - ~cape-capf-interactive~, ~cape-interactive~: Create a Capf which can be 
called interactively.
diff --git a/cape.el b/cape.el
index d231794402..ea7277a37f 100644
--- a/cape.el
+++ b/cape.el
@@ -1117,9 +1117,9 @@ This function can be used as an advice around an existing 
Capf."
 
 ;;;###autoload
 (defun cape-wrap-inside-code (capf)
-  "Call CAPF only if inside not inside a comment.
+  "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 (nth 4 (syntax-ppss))) (funcall capf)))
+  (and (not (or (nth 3 (syntax-ppss)) (nth 4 (syntax-ppss)))) (funcall capf)))
 
 ;;;###autoload
 (defun cape-wrap-inside-comment (capf)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]