]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: Restore string fence properties at each relevant external entry point
authorAlan Mackenzie <acm@muc.de>
Sun, 22 May 2022 16:55:05 +0000 (16:55 +0000)
committerAlan Mackenzie <acm@muc.de>
Sun, 22 May 2022 17:00:34 +0000 (17:00 +0000)
commit2f68673a712508f70de20f485422c7e01b8ab21b
tree1cbe449cc8659307fa1149be1e1b6ddb0ed298da
parent45694a25948146e860738cb4e01de7e7e9aa91b0
CC Mode: Restore string fence properties at each relevant external entry point

This fixes bug #55230.

* lisp/progmodes/cc-defs.el (c-string-fences-set-flag, c-with-string-fences):
New variable and macro.

* lisp/progmodes/cc-mode.el (c-called-from-text-property-change-p): Add
remove-text-properties to the list of accepted functions.
(c-clear-string-fences, c-restore-string-fences): Surround the functions'
innards with c-save-buffer-state to prevent text property changes causing
change functions to be called.
(c-before-change, c-after-change, c-font-lock-fontify-region): Replace the
explicit calls to c-restore-string-fences and c-clear-string-fences with
invocations of the new macro c-with-string-fences.

* lisp/progmodes/cc-awk.el (c-awk-extend-and-syntax-tablify-region)
(c-awk-end-of-defun)
* lisp/progmodes/cc-cmds.el (c-show-syntactic-information)
(c-electric-backspace, c-hungry-delete-backwards, c-electric-delete-forward)
(c-hungry-delete-forward, c-electric-pound, c-electric-brace)
(c-electric-slash, c-electric-star, c-electric-semi&comma, c-electric-colon)
(c-electric-lt-gt, c-electric-paren, c-beginning-of-defun, c-end-of-defun)
(c-display-defun-name, c-mark-function, c-beginning-of-statement)
(c-end-of-statement, c-indent-command, c-indent-exp, c-indent-defun)
(c-indent-line-or-region, c-fill-paragraph, c-indent-new-comment-line)
(c-context-line-break)
* lisp/progmodes/cc-guess.el (c-guess-region-no-install): These are all
"boundary" functions to CC Mode.  Surround each by c-with-string-fences.
lisp/progmodes/cc-awk.el
lisp/progmodes/cc-cmds.el
lisp/progmodes/cc-defs.el
lisp/progmodes/cc-guess.el
lisp/progmodes/cc-mode.el