From bfde79ed440343c0dbf0f64cfe7913c1efbe3f83 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Wed, 31 Jan 2024 00:01:20 +0100 Subject: Improve cape-wrap-inside-code --- cape.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.0