Subject: bug#70365: 29.2; Unable to remove suffixes such as Emacs-Lisp/l or C++//l from mode-name variable

From: Eli Zaretskii <[email-masked]>
Date: Sat, 13 Apr 2024 15:00:39 +0300

[Please use Reply All to reply, to keep the bug tracker CC'ed.]

> From: Animesh Sahu <[email-masked]>
> Date: Sat, 13 Apr 2024 16:18:20 +0530
> 
> I would not like this to be a per-mode fix for every language, I already linked closest I could get to this issue, in
> my previous mail:
> 
> > Closest I could find something is here:
> https://www.reddit.com/r/emacs/comments/8v8de4/change_modename_for_major_mode/ it suggests doing
> something like (defalias 'c-update-modeline #'ignore), but this doesn't seem right way to do it, since its
> basically doing only for C or C++ language, same has to be done for java, ts, many more. Also Emacs-Lisp/l
> doesn't have similar function that can be suppressed with 'ignore either, so I don't see a concrete way of
> doing it.

You should be able to do this globally in a
after-change-major-mode-hook, I think.  Although I don't think I
understand how you can do that regardless of the mode, since you
cannot know in advance what will a mode possibly append to mode-name
-- it could be something you want to leave alone in some modes.  So a
mode-specific setting sounds like the best idea to me, if you ask me.

There's also the other possibility I mentioned: to modify
mode-line-modes so as to use some other variable for showing the mode
name.  You can then control the value of that variable.  This is not a
mode specific solution.

> I would like to have these variables populated by their own modes. Although I don't find a generic way to
> disable that in all the languages / major modes. 

I'm not sure what is it that you expect us to do here.  We are not
going to change how these mode names are displayed by default, so
whatever you want to do it will have to be in your own local
customizations.  I've pointed out several possible ways of performing
such customizations.  If this is not enough, or you need more
assistance in accomplishing this, I suggest to post a question on
[email-masked], where people could help you implement this.