]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: correct handling of properties on #include <...>
authorAlan Mackenzie <acm@muc.de>
Fri, 25 Oct 2024 20:35:32 +0000 (20:35 +0000)
committerEshel Yaron <me@eshelyaron.com>
Sat, 26 Oct 2024 16:45:47 +0000 (18:45 +0200)
commitedd753716f9c2a3893f53922ef50b5a3b1849e36
tree495531b1d8fbe6c70bf98f80c4b7194ed16825e6
parent74691bec84cd5c3ff43a08b916d11eb6e987ecab
CC Mode: correct handling of properties on #include <...>

In C, Pike, and IDL Modes, deleting and reinserting such a <
could create havoc with the category/syntax-table properties on
the < and >.  Also the contents of <...> should only get paren
properties when the #include is present and correct.

* lisp/progmodes/cc-fonts.el (c-cpp-matchers): Replace the
c-make-font-lock-search-function which put properties on the
<...> with a simple matcher.

* lisp/progmodes/cc-langs.el
(c-get-state-before-change-functions)
(c-before-font-lock-functions): Add respectively
c-before-change-include-<> and c-after-change-include-<> in the
C, Pike and IDL entries of these variables.

* lisp/progmodes/cc-mode.el (c-before-change-include-<>)
(c-after-change-include-<>): New functions.

(cherry picked from commit 76268160ba9262a8479589427b8e783db0242260)
lisp/progmodes/cc-fonts.el
lisp/progmodes/cc-langs.el
lisp/progmodes/cc-mode.el