From: Alan Mackenzie Date: Sun, 31 Dec 2023 11:02:50 +0000 (+0000) Subject: CC Mode. Preserve space syntax-table props in open strings X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=732227c8ba7e898a4868ccc48d950551916c84b2;p=emacs.git 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. (cherry picked from commit 91f316d293150c6d025c61949c24fc07136fb1fd) --- 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)))))))))