Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line

From: Juri Linkov <[email-masked]>
Date: Sun, 30 Jun 2024 09:50:36 +0300

>> After all, the project-mode-line
>> option belongs to project.el, so the fact that it adds the project
>> name to the mode line too indiscriminately can legitimately be
>> considered to be a problem with that option.  Right?
>
> It's "discriminate" and off by default.
>
>> On top of that,
>> project-mode-line is new in Emacs 30, whereas Eglot has been showing
>> the project in its mode line before that.  So once again, IMO the onus
>> is on project.el to fix this somehow.  For example, by not adding this
>> to the mode line in Eglot-controlled buffers.
>
> Hard-coding an "unless Eglot" condition seems like a bad idea in terms of
> abstraction and general code logic.

I completely agree.  When a user explicitly expressed the wish
to display the project name in the middle of the mode line by
customizing project-mode-line to t, this means there is no need
to duplicate it at the end of the mode line with Eglot information.
This will make the mode line shorter.

Ideally, everything should be customizable by two new Eglot options:
eglot-mode-line-format and eglot-mode-line-position (e.g. middle/end).