]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: Fix multiline block comments in macros.
authorAlan Mackenzie <acm@muc.de>
Thu, 2 May 2019 14:30:29 +0000 (14:30 +0000)
committerAlan Mackenzie <acm@muc.de>
Thu, 2 May 2019 14:33:05 +0000 (14:33 +0000)
commit39acaff574140b67ef5311c5764a6b3b29491991
tree3189f1fe8afe8bd4985a021eb3e271dc523bda8a
parent3fa9c9f774277530f4dac6c4f5de157cb4cdc536
CC Mode: Fix multiline block comments in macros.

In particulr, handle multiline block comments whose newlines are not escaped.
There is an example of this in #define EXTRA_CONTEXT_FIELDS in editfns.c.

* lisp/progmodes/cc-engine.el (c-beginning-of-macro, c-end-of-macro): Enclose
the loops scanning escaped newlines with outer loops which check
heuristically for, respectively, a block comment ender and a block comment
starter on the lines we end up on.  (A rigorous syntactic check would be too
slow, here.)

* lisp/progmodes/cc-langs.el (c-last-c-comment-end-on-line-re)
(c-last-open-c-comment-start-on-line-re): New language constants/variables.
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-langs.el