summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp-mnt.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2024-09-24 20:45:29 +0000
committerAlan Mackenzie <acm@muc.de>2024-09-24 20:45:29 +0000
commitc2d6f191d489de8349847b5c18acec8462b66247 (patch)
treedaa8003f17123a3777aac62bc37c49552ffba927 /lisp/emacs-lisp/lisp-mnt.el
parente8f5df5175170d36f526e46b63b3d428bb9a8950 (diff)
downloademacs-c2d6f191d489de8349847b5c18acec8462b66247.tar.gz
emacs-c2d6f191d489de8349847b5c18acec8462b66247.tar.bz2
emacs-c2d6f191d489de8349847b5c18acec8462b66247.zip
CC Mode: Separate indentation of enums from that of brace lists
This will allow enums to be indented as in the GNU coding standards without affecting brace lists. * lisp/progmodes/cc-align.el (c-lineup-arglist-intro-after-paren) (c-lineup-arglist-close-under-paren) (c-lineup-whitesmith-in-block) (c-lineup-after-whitesmith-blocks): Amend doc strings to indicate they can be used for enum-* syntactic symbols too. * lisp/progmodes/cc-engine.el (c-looking-at-decl-block) (c-backward-typed-enum-colon, c-backward-over-enum-header): Rename c-after-brace-list-key to c-after-enum-list-key and c-brace-list-key to c-enum-list-key. (c-at-enum-brace): New function. (c-inside-bracelist-p): Don't check for enums any more. (c-add-stmt-syntax): New cond arm for enums. (c-guess-continued-construct CASE B.6) New code for enum-open. (c-guess-basic-syntax CASE 5A.3, CASE 7B, CASE 9, CASE 9B) (CASE 9C, CASE 9D): Use the new function c-at-enum-brace, and use enum-* syntactic symbols rather than brace-list-* ones where appropriate. (c-used-syntactic-symbols): New dynamic variable. (c-evaluate-offset): Add handling for a different syntactic symbol as the cdr of a c-offsets-alist element. * lisp/progmodes/cc-fonts.el (c-get-fontification-context): Add a call to c-at-enum-brace since c-inside-bracelist-p no longer handles enums. (c-font-lock-enum-body, c-font-lock-enum-tail): Condense calls to c-backward-over-enum-header to c-at-enum-brace. (c-basic-matchers-after): Replace a c-brace-list-decl-kwds with c-enum-list-kwds. * lisp/progmodes/cc-langs.el (c-enum-list-kwds) (c-enum-list-key): New names for c-brace-list-decl-kwds and c-brace-list-key. (c-after-enum-list-kwds, c-after-enum-list-key): New names for c-after-brace-list-decl-kwds and c-after-brace-list-key. (c-enum-list-key, c-after-enum-list-key): Add code to use a value of an old name, should a derived mode still use that. (c-defun-type-name-decl-kwds, c-typedef-decl-kwds) (c-typeless-decl-kwds, c-prefix-spec-kwds) (c-brace-id-list-kwds, c-enum-clause-introduction-re): Use c-enum-list-kwds rather than c-brace-list-decl-kwds. * lisp/progmodes/cc-styles.el (c-read-offset): Add "a syntactic symbol" into an error message text. * lisp/progmodes/cc-vars.el (c-valid-offset): Allow for a syntactic symbol as the parameter. (c-offsets-alist): Add new syntactic symbols enum-open, enum-close, enum-intro, and enum-entry. * doc/misc/cc-mode.texi (Syntactic Symbols): Add a note that anchor points are briefly documented in cc-vars.el. Correct the suffix "-block-intro" to "-intro". Remove "an enum or" from the descriptions of the brace-list-* syntactic symbols. Add in new descriptions for the enum-* syntactic symbols. (Brace List Symbols): Remove references to enums. Add a note that enums are no longer brace-lists. (Enum Symbols): A new subsection documenting the new enum-* syntactic symbols. (c-offsets-alist): Document the new possibility, syntactic symbol, for the cdr of an alist entry. (Brace/Paren Line-Up, List Line-Up): Note that the new enum syntactic symbols can be handled by these lineup functions.
Diffstat (limited to 'lisp/emacs-lisp/lisp-mnt.el')
0 files changed, 0 insertions, 0 deletions