emacs-diffs
[Top][All Lists]
Advanced

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

master 91f316d2931: CC Mode. Preserve space syntax-table props in open s


From: Alan Mackenzie
Subject: master 91f316d2931: CC Mode. Preserve space syntax-table props in open strings
Date: Sun, 31 Dec 2023 06:05:23 -0500 (EST)

branch: master
commit 91f316d293150c6d025c61949c24fc07136fb1fd
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    CC Mode.  Preserve space syntax-table props in open strings
    
    This fixes bug#68111, allowing, e.g., backward-kill-word to
    work properly.
    
    * lisp/progmodes/cc-mode.el (c-clear-string-fences): On an open
    string which isn't followed by another string, remove the
    syntax-table properties just from template delimiters rather
    than setting the syntax-table properties of all the string to
    punctuation.
---
 lisp/progmodes/cc-mode.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 4842de15164..b4356c1c887 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -1377,8 +1377,14 @@ Note that the style variables are always made local to 
the buffer."
                       (not (nth 3 s))
                       (c-get-char-property (1- (point)) 'c-fl-syn-tab))
                    (c-put-char-property pos 'syntax-table '(1))
-                   (c-put-char-properties (1+ pos) (c-point 'eol pos)
-                                          'syntax-table '(1)))
+                   ;; Remove syntax-table text properties from template
+                   ;; delimiters.
+                   (c-clear-char-property-with-value
+                    (1+ pos) (c-point 'eol pos)
+                    'syntax-table c-<-as-paren-syntax)
+                   (c-clear-char-property-with-value
+                    (1+ pos) (c-point 'eol pos)
+                    'syntax-table c->-as-paren-syntax))
                  (setq pos (point)))
              (setq pos (1+ pos)))))))))
 



reply via email to

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