Create a toggle between block and line comments in CC Mode.
commit7a2038d7c887e4fa08a91950a7494d1dd20c39e1
authorAlan Mackenzie <acm@muc.de>
Thu, 15 Jun 2017 20:47:11 +0000 (15 20:47 +0000)
committerAlan Mackenzie <acm@muc.de>
Thu, 15 Jun 2017 21:03:03 +0000 (15 21:03 +0000)
tree3aca6adb27e83c129c9a2f2cebffef55e679fcde
parent21d10e59f89a5bb72829ffb8ebe4463ba4fac124
Create a toggle between block and line comments in CC Mode.

Also (unrelated change) initialize the modes' keymaps at each loading.

* lisp/progmodes/cc-cmds.el (c-update-modeline): amend for the new information
on the modeline.
(c-block-comment-flag): New variable.
(c-toggle-comment-style): New function.

* lisp/progmodes/cc-langs.el (c-block-comment-starter)
(c-line-comment-starter): Make them c-lang-defvars.
(c-block-comment-is-default): New c-lang-defvar.
(comment-start, comment-end): Make the default values dependent on
c-block-comment-is-default.

* lisp/progmodes/cc-mode.el (c-mode-base-map): Define C-c C-k in this map.
(c-basic-common-init): Initialize c-block-comment-flag.
(c-mode-map, c++-mode-map, objc-mode-map, java-mode-map, idl-mode-map)
(pike-mode-map, awk-mode-map): Make entries in these key maps each time the
mode is loaded rather than just once per Emacs session.

* doc/misc/cc-mode.texi (Comment Commands): Introduce the notion of comment
style.
(Minor Modes): Define comment style.  Describe how comment style influences
the information displayed on the modeline.  Document c-toggle-comment-style.
(FAQ): Add a question about toggling the comment style.
doc/misc/cc-mode.texi
lisp/progmodes/cc-cmds.el
lisp/progmodes/cc-langs.el
lisp/progmodes/cc-mode.el