]> git.eshelyaron.com Git - emacs.git/commit
Support mode line constructs for 'mode-name' in c-mode (bug#2034)
authorPhil Sainty <psainty@orcon.net.nz>
Mon, 2 Jul 2018 11:58:34 +0000 (23:58 +1200)
committerPhil Sainty <psainty@orcon.net.nz>
Sat, 7 Jul 2018 13:20:10 +0000 (01:20 +1200)
commit6a4477d057e8e35698c34193e928089290b16a58
treef7800b55806b675c6294445c145dba65ebeff972
parent4ee502ca9db022ef85c736888ec6d6b471e0332a
Support mode line constructs for 'mode-name' in c-mode (bug#2034)

Also make the inclusion of minor mode flags in 'mode-name' optional.

* lisp/progmodes/cc-vars.el (c-modeline-display-flags): New user
option.
* lisp/progmodes/cc-cmds.el (c-modeline-flags): New variable.
(c--modeline-major-mode): New internal buffer-local variable.
(c-update-modeline): Use mode line constructs, rather than string
concatenation, to optionally include minor mode flags in 'mode-name'.

* lisp/progmodes/cc-cmds.el (c-toggle-auto-newline)
(c-toggle-hungry-state, c-toggle-auto-hungry-state)
(c-toggle-electric-state, c-toggle-comment-style):
* lisp/progmodes/cc-mode.el (c-electric-indent-mode-hook)
(c-electric-indent-local-mode-hook): Remove redundant calls to
'c-update-modeline'.  It is no longer necessary to call this function
every time one of the minor mode states changes.  The remaining calls
are in 'c-basic-common-init' (which is called via 'c-common-init' by
all the major modes defined in cc-mode.el), and in the :after-hook of
those modes (which ensures that 'mode-name' is still processed for a
derived mode that doesn't call 'c-common-init' itself).

* lisp/progmodes/cc-mode.el (c-submit-bug-report):
* lisp/progmodes/cc-styles.el (c-set-style): Format 'mode-name'.

* doc/misc/cc-mode.texi: Document 'c-modeline-display-flags'.

* etc/NEWS: Mention new user option and behaviors.

* lisp/progmodes/cc-engine.el:
* lisp/progmodes/cc-mode.el: Remove commented remnants of
'c-submode-indicators'.  This code was commented out in commit
cb694ab73063cc92342daf96d009cdc6d086bc0b in which the indicators were
moved directly into 'mode-name' (to prevent lighter text for other
minor modes from appearing inbetween).  These indicators are now
replaced by 'c-modeline-flags'.
doc/misc/cc-mode.texi
etc/NEWS
lisp/progmodes/cc-cmds.el
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-mode.el
lisp/progmodes/cc-styles.el
lisp/progmodes/cc-vars.el