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'.