]> git.eshelyaron.com Git - emacs.git/commit
CC Mode: Don't do c-backward-syntactic-ws following a forward movement
authorAlan Mackenzie <acm@muc.de>
Mon, 23 Jan 2023 20:25:53 +0000 (20:25 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 23 Jan 2023 20:25:53 +0000 (20:25 +0000)
commit29a8a1885d9f4825190d2575849f7605b3d6dffb
treec8a369fde061b9ff8a13213eb6c5c05fd6863bad
parent3e62ddc0d87dfceb67af49c5f1caee4d03fc33b8
CC Mode: Don't do c-backward-syntactic-ws following a forward movement

This was happening in, e.g., c-forward-type, which moves over whitespace at
the end of the scanned type.  This WS movement can exit a comment or a macro,
such that a c-backward-syntactic-ws does not return to the desired point, but
to before the entire comment/macro.

* lisp/progmodes/cc-engine.el (c-forward-keyword-prefixed-id)
(c-forward-id-comma-list, c-forward-noise-clause, c-forward-keyword-clause)
(c-forward-name, c-forward-type): Add a new &optional parameter `stop-at-end'
which when non-nil means "do not move over syntactic WS after performing the
main job", and adapt the internals of these macros and functions accordingly.
(c-forward-declarator, c-forward-decl-or-cast-1): In the calls to
c-forward-type and c-forward-name, set the stop-at-end argument to t, and call
c-forward-sytactic-ws later.
lisp/progmodes/cc-engine.el