1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00

On leaving CC Mode, clean up by removing character properties.

* lisp/progmodes/cc-mode.el (c-leave-cc-mode-mode): Remove from the buffer
all instances of the text properties/extents category, syntax-table,
c-is-sws, c-in-sws, c-type, and c-awk-NL-prop.
This commit is contained in:
Alan Mackenzie 2016-02-07 15:06:43 +00:00
parent 90c647b97f
commit 7149cc54e7

View file

@ -141,7 +141,18 @@
;; derived-mode-ex.el>.
(defun c-leave-cc-mode-mode ()
(setq c-buffer-is-cc-mode nil))
(when c-buffer-is-cc-mode
(save-restriction
(widen)
(c-save-buffer-state ()
(c-clear-char-properties (point-min) (point-max) 'category)
(c-clear-char-properties (point-min) (point-max) 'syntax-table)
(c-clear-char-properties (point-min) (point-max) 'c-is-sws)
(c-clear-char-properties (point-min) (point-max) 'c-in-sws)
(c-clear-char-properties (point-min) (point-max) 'c-type)
(if (c-major-mode-is 'awk-mode)
(c-clear-char-properties (point-min) (point-max) 'c-awk-NL-prop))))
(setq c-buffer-is-cc-mode nil)))
(defun c-init-language-vars-for (mode)
"Initialize the language variables for one of the language modes