Subject: Re: bug#2034: [PATCH] 27.0.50; Support mode line constructs for `mode-name' in c-mode

From: Eli Zaretskii <[email-masked]>
Date: Mon, 02 Jul 2018 18:29:26 +0300

> From: Phil Sainty <[email-masked]>
> Date: Tue, 3 Jul 2018 00:40:49 +1200
> 
> `c-update-modeline' in cc-cmds.el has a long-standing bug (and FIXME
> comment) whereby a `mode-name' which is not a string will trigger
> errors, on account of the function using string manipulations to add
> the minor mode flags to the original `mode-name'.
> 
> This is what bug #2034 was originally about. i.e.:
> 
> > c-update-modeline: Wrong type argument: stringp,
> > (sgml-xml-mode "XML" "SGML")
> 
> This new patch instead uses mode-line constructs to concatenate the
> flags, thus eliminating the string manipulation code and this bug.

I've just skimmed the patch, so apologies in advance if what I'm
saying makes no sense.  That said, did you try to compare the old and
the new code when the flag strings have text properties, like faces or
colors?  The mode-line formatting code is tricky when text properties
are involved.

> +(defcustom c-modeline-display-flags t
> +  "If non-nil, `mode-name' includes indicators for certain minor modes.
> +
> +These flags are set by `c-update-modeline'.
> +
> +See Info node `(ccmode) Minor Modes'."
> +  :type 'boolean
> +  :group 'c)

Please always provide a :version tag for new/modified defcustoms.

Finally, I think this needs a NEWS entry, if not a suitable change to
the manual.

Thanks.