Subject: CC Mode 5.33.1 (PHP//l); Issues with CC mode minor modes

From: Brian Zwahr <[email-masked]>
Date: Fri, 15 Jun 2018 09:17:59 -0500

While using php-mode, I noticed some issues in cc modes when it comes to
the minor modes (like subword-mode, etc).

The documentation gives examples of how the mode line changes
when these minors modes are enabled. For instance, the documentation
says that when all the modes are enabled (in c-mode), the mode line
should show `C/lahw`. However, when I enable them all, I see `C/*lah ,`.

There are a couple of issues you'll notice here. First is that instead
of subword-mode adding `w` to the mode line, it adds ` ,` (space comma).

Second, there's an asterisk after the slash that isn't mentioned in the
documentation. In php-mode and c++-mode, instead of an asterisk, there's
a second slash (example: `PHP//l` or `C++//l`). It seems like this
represents something about comment, though I'm not sure what exactly,
nor why it is useful information.

Finally, enabling c-toggle-syntactic-indentation doesn't change the mode
line at all. It seems as though it is missing a call to
c-update-modeline. However, the documentation also doesn't specify what
should be added to the mode line for this one, so perhaps this is
expected behavior. If so, should that be explicitly stated in the
documentation? It's strange that 1 out of 5 minor modes don't change the
mode line.

I asked about this on Reddit, which is where I got some of the
information I've added here. For reference, the post can be viewed here:

https://www.reddit.com/r/emacs/comments/8r47xw/what_are_the_slashes_and_asterisks_in_the/

Emacs  : GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-05-29
Package: CC Mode 5.33.1 (PHP//l)
Buffer Style: symfony2
c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties 1-bit)

current state:
==============
(setq
 c-basic-offset 4
 c-comment-only-line-offset 0
 c-indent-comment-alist '((anchored-comment column . 0) (end-block space . 1)
                          (cpp-end-block space . 2))
 c-indent-comments-syntactically-p t
 c-block-comment-prefix "* "
 c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+")
                           (other . "//+\\|\\**"))
 c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode . gtkdoc))
 c-cleanup-list '(scope-operator)
 c-hanging-braces-alist '((brace-list-open) (brace-entry-open) (statement-cont)
                          (substatement-open after) (block-close . c-snug-do-while)
                          (extern-lang-open after) (namespace-open after)
                          (module-open after) (composition-open after)
                          (inexpr-class-open after) (inexpr-class-close before)
                          (arglist-cont-nonempty))
 c-hanging-colons-alist nil
 c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist)
 c-backslash-column 48
 c-backslash-max-column 72
 c-special-indent-hook nil
 c-label-minimum-indentation 1
 c-offsets-alist '((inexpr-class . +)
                   (inexpr-statement . +)
                   (lambda-intro-cont . +)
                   (inlambda . 0)
                   (template-args-cont c-lineup-template-args +)
                   (incomposition . +)
                   (inmodule . +)
                   (innamespace . +)
                   (inextern-lang . +)
                   (composition-close . 0)
                   (module-close . 0)
                   (namespace-close . 0)
                   (extern-lang-close . 0)
                   (composition-open . 0)
                   (module-open . 0)
                   (namespace-open . 0)
                   (extern-lang-open . 0)
                   (objc-method-call-cont
                    c-lineup-ObjC-method-call-colons
                    c-lineup-ObjC-method-call
                    +
                    )
                   (objc-method-args-cont . c-lineup-ObjC-method-args)
                   (objc-method-intro . [0])
                   (friend . 0)
                   (cpp-define-intro c-lineup-cpp-define +)
                   (cpp-macro-cont . +)
                   (cpp-macro . [0])
                   (inclass . +)
                   (stream-op . c-lineup-streamop)
                   (arglist-cont-nonempty
                    first
                    php-lineup-cascaded-calls
                    c-lineup-arglist
                    )
                   (arglist-cont first php-lineup-cascaded-calls 0)
                   (comment-intro . 0)
                   (catch-clause . 0)
                   (else-clause . 0)
                   (do-while-closure . 0)
                   (access-label . -)
                   (case-label . +)
                   (substatement . +)
                   (statement-case-intro . +)
                   (statement . 0)
                   (brace-entry-open . 0)
                   (brace-list-entry . c-lineup-under-anchor)
                   (brace-list-close . 0)
                   (block-close . 0)
                   (block-open . 0)
                   (inher-cont . c-lineup-multi-inher)
                   (inher-intro . +)
                   (member-init-cont . c-lineup-multi-inher)
                   (member-init-intro . +)
                   (annotation-var-cont . +)
                   (annotation-top-cont . 0)
                   (topmost-intro . 0)
                   (knr-argdecl . 0)
                   (func-decl-cont . +)
                   (inline-close . 0)
                   (class-close . 0)
                   (class-open . 0)
                   (defun-block-intro . +)
                   (defun-close . 0)
                   (defun-open . 0)
                   (c . c-lineup-C-comments)
                   (string . c-lineup-dont-change)
                   (topmost-intro-cont first php-lineup-cascaded-calls +)
                   (brace-list-intro . +)
                   (brace-list-open . 0)
                   (inline-open . 0)
                   (arglist-close . php-lineup-arglist-close)
                   (arglist-intro . php-lineup-arglist-intro)
                   (statement-cont . php-lineup-hanging-semicolon)
                   (statement-case-open . 0)
                   (label . +)
                   (substatement-label . 2)
                   (substatement-open . 0)
                   (knr-argdecl-intro . +)
                   (statement-block-intro . +)
                   )
 c-buffer-is-cc-mode 'php-mode
 c-tab-always-indent t
 c-syntactic-indentation t
 c-syntactic-indentation-in-macros t
 c-ignore-auto-fill '(string cpp code)
 c-auto-align-backslashes t
 c-backspace-function 'backward-delete-char-untabify
 c-delete-function 'delete-char
 c-electric-pound-behavior nil
 c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu"))
 c-enable-xemacs-performance-kludge-p nil
 c-old-style-variable-behavior nil
 defun-prompt-regexp "^\\s-*function\\s-+&?\\s-*\\(\\(\\sw\\|\\s_\\)+\\)\\s-*"
 tab-width 4
 comment-column 32
 parse-sexp-ignore-comments t
 parse-sexp-lookup-properties t
 auto-fill-function nil
 comment-multi-line t
 comment-start-skip "\\(//+\\|/\\*+\\)\\s *"
 fill-prefix nil
 fill-column 78
 paragraph-start "[ 	]*\\(//+\\|\\**\\)[ 	]*\\(@[a-zA-Z]+\\>\\|$\\)\\|^\f"
 adaptive-fill-mode t
 adaptive-fill-regexp "[ 	]*\\(//+\\|\\**\\)[ 	]*\\([ 	]*\\([-–!|#%;>*·•‣⁃◦]+[ 	]*\\)*\\)"
 )