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: Juri Linkov <juri <at> linkov.net>
To: sbaugh <at> catern.com
Cc: Spencer Baugh <sbaugh <at> janestreet.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: Sun, 30 Jun 2024 19:38:59 +0300
> 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.

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).




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.