GNU bug report logs - #71823
31.0.50; project-mode-line and eglot duplicate project-name in mode-line

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Fri, 28 Jun 2024 14:14:02 UTC

Severity: normal

Found in version 31.0.50

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Spencer Baugh <sbaugh <at> janestreet.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: sbaugh <at> catern.com, Eli Zaretskii <eliz <at> gnu.org>, João Távora <joaotavora <at> gmail.com>, 71823 <at> debbugs.gnu.org, Dmitry Gutov <dmitry <at> gutov.dev>
Subject: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line
Date: Wed, 03 Jul 2024 09:00:43 -0400
Juri Linkov <juri <at> linkov.net> writes:
>> I do think this is a great way to resolve this - now that
>> project-mode-line exists, using it deletes one small bit of
>> eglot-specific functionality, which is in line with the Eglot design
>> philosophy.
>>
>> The only issue is that this was only added to mode-line-format in Emacs
>> 30, so we can only use it in Emacs 30 or later.
>>
>> The attached patch detects that with:
>>
>> +    (when (member '(project-mode-line project-mode-line-format) mode-line-format)
>>
>> but I'm also totally fine with:
>>
>> +    (when (version<= "30" emacs-version)
>>
>> Or I guess we could sidestep the issue if project.el itself ensured,
>> when loaded, that mode-line-format contains project-mode-line.  eglot
>> itself does this with eglot--mode-line-format, running the following at
>> load time:
>>
>>   (add-to-list 'mode-line-misc-info
>>              `(eglot--managed-mode (" [" eglot--mode-line-format "] ")))
>>
>> Juri, any opinion?
>
> bindings.el already contains '(project-mode-line project-mode-line-format),
> so checking this with (member '(project-mode-line project-mode-line-format)
> mode-line-format) looks fine.

Will do that in the next version of the patch.

> OTOH, I'm not sure if using (setq-local project-mode-line t)
> would be appreciated by users.  I think your initial patch
> was more correct with (bound-and-true-p project-mode-line).

I was also unsure, but after thinking about it, I think it's actually
quite reasonable, for this reason: anyone enabling eglot already had
project-name in their modeline.

This patch just moves the project-name from the [eglot] element to a
separate mode-line element.  So this doesn't actually change the
contents of an eglot user's mode-line, just the order of the elements.

Plus the separate element has the mouse-1 project menu, which is a nice
addition.




This bug report was last modified 117 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.