diff options
author | Alan Mackenzie <acm@muc.de> | 2017-10-22 14:18:20 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2017-10-22 14:18:20 +0000 |
commit | b7c4aa951c8b12629742df9d20d6374c3d2a8ba8 (patch) | |
tree | a3b86aa4e129b208ca796325f996c2e0e8a17563 /lisp/progmodes/cc-cmds.el | |
parent | 3aee7be62eaf8caef6f2fab31bee79674b3abbb7 (diff) | |
download | emacs-b7c4aa951c8b12629742df9d20d6374c3d2a8ba8.tar.gz emacs-b7c4aa951c8b12629742df9d20d6374c3d2a8ba8.tar.bz2 emacs-b7c4aa951c8b12629742df9d20d6374c3d2a8ba8.zip |
Refactor c-forward-token-2 with new function c-forward-over-token-and-ws.
Use the new function directly in several places where c-forward-token-2
wouldn't move over the last token in the buffer. This caused an infinite loop
in c-restore-<>-properties.
* lisp/progmodes/cc-engine.el (c-forward-over-token-and-ws): New function,
extracted from c-forward-token-2.
(c-forward-token-2): Refactor, calling the new function.
(c-restore-<>-properties): Fix infinite loop.
(c-forward-<>-arglist-recur, c-in-knr-argdecl)
(c-looking-at-or-maybe-in-bracelist): Call the new function directly in place
of c-forward-token-2.
* lisp/progmodes/cc-cmds.el (c-defun-name) Call the new function directly in
place of c-forward-token-2.
* lisp/progmodes/cc-fonts.el (c-font-lock-enclosing-decls): Call the new
function directly in place of c-forward-token-2.
Diffstat (limited to 'lisp/progmodes/cc-cmds.el')
-rw-r--r-- | lisp/progmodes/cc-cmds.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 5c8bbebf31b..ca64b544200 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -1852,7 +1852,7 @@ with a brace block." ;; struct, union, enum, or similar: ((looking-at c-type-prefix-key) (let ((key-pos (point))) - (c-forward-token-2 1) ; over "struct ". + (c-forward-over-token-and-ws) ; over "struct ". (cond ((looking-at c-symbol-key) ; "struct foo { ..." (buffer-substring-no-properties key-pos (match-end 0))) |