summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2023-12-31 11:02:50 +0000
committerAlan Mackenzie <acm@muc.de>2023-12-31 11:02:50 +0000
commit91f316d293150c6d025c61949c24fc07136fb1fd (patch)
tree7fdf654a933ec98af15197c10532aea8713f7432
parentbbd372da53302daa771efe0350bf46783aba3af7 (diff)
downloademacs-91f316d293150c6d025c61949c24fc07136fb1fd.tar.gz
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.
-rw-r--r--lisp/progmodes/cc-mode.el10
1 files 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)))))))))