]> git.eshelyaron.com Git - emacs.git/commit
CC Mode. Fix (c-beginning-of-defun -1) getting stuck with structs.
authorAlan Mackenzie <acm@muc.de>
Sun, 28 Jul 2019 13:30:38 +0000 (13:30 +0000)
committerAlan Mackenzie <acm@muc.de>
Sun, 28 Jul 2019 13:30:38 +0000 (13:30 +0000)
commitdcba39b445e8f71c5f8df34a38ae8fc726a51843
treea417520b3d343bf3b50008ddfa42ccb60f7a0a90
parentba952d654ad005826a6a219fa97b49af30193cca
CC Mode.  Fix (c-beginning-of-defun -1) getting stuck with structs.

In particular, with an initialization such as struct foo {..} bar = {...};

* lisp/progmodes/cc-cmds.el (c-forward-to-nth-EOF-{): Rename to
c-forward-to-nth-EOF-\;-or-}, and when the starting (or ending) position is in
the "variable" part of a struct/class/union/enum/etc., move to after the
terminating semicolon.  Adjust the counting such that N only gets decremented
on a successful movement over {..}.
(c-beginning-of-defun, c-end-of-defun): Rename the calls to
c-forward-to-nth-EOF-}, as above.
lisp/progmodes/cc-cmds.el