GNU bug report logs - #48747
28.0.50; add project-name generic

Previous Next

Package: emacs;

Reported by: Stephen Leake <stephen_leake <at> stephe-leake.org>

Date: Sun, 30 May 2021 17:40:01 UTC

Severity: wishlist

Found in version 28.0.50

Done: Stephen Leake <stephen_leake <at> stephe-leake.org>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 48747 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Stephen Leake <stephen_leake <at> stephe-leake.org>, 48747 <at> debbugs.gnu.org
Subject: Re: bug#48747: add project-name generic
Date: Mon, 21 Nov 2022 00:57:33 +0200
On 21.11.2022 00:17, Stephen Leake wrote:
> eglot builds a name for a server using the root directory of the
> project - in effect:
> 
> (file-name-base (directory-file-name (project-root (project-current))))
> 
> That name shows up in the elgot mode line, to tell the user which server
> the buffer is connected to, in progress report messages, and in the name
> of the EGLOT log buffer, which is useful for debugging things.
> 
> If the project root directory happens to have a meaningful name, that's
> fine. In my use cases, it's usually not meaningful. For example, I have
> two worktrees of my wisitoken project, one for the main branch, one for
> a work branch. The eglot names, and the ones I'd like to see, are:
> 
>      default     desired
>      "build"     "wisitoken main"
>      "build"     "wisitoken work"
> 
> Similarly, the name for the ada_language_server worktree is:
> 
>      "gnat"      "als main"
> 
> I could override project-name that in my projects to provide my desired
> name, and eglot will use my desired name.

Okay, that sounds good.

But let's please go back to my question: could we use the new generic in 
project-prompt-project-dir? And should we?

If we do, we'll have to default the return value to

  (abbreviate-file-name (project-root pr))

rather than your suggested

  (file-name-base (directory-file-name (project-root pr)))

. Would you say you intend to override project-name a lot? Or do you 
want to take advantage of the shorter default name in most cases?

What do you think about the first option anyway?

OTOH, it's also possible that some Powerline-style mode-line packages 
might want to use this method as well. And it seems they generally 
prefer the latter look because it's more compact. They currently don't 
show such info, though.




This bug report was last modified 2 years and 242 days ago.

Previous Next


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