unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Stephen Leake <stephen_leake@stephe-leake.org>, 48747@debbugs.gnu.org
Subject: bug#48747: add project-name generic
Date: Mon, 21 Nov 2022 00:57:33 +0200	[thread overview]
Message-ID: <9b4aded1-5dda-25c8-8144-71aa9727353c@yandex.ru> (raw)
In-Reply-To: <86o7t1l18h.fsf@stephe-leake.org>

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.





  reply	other threads:[~2022-11-20 22:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-30 17:38 bug#48747: 28.0.50; add project-name generic Stephen Leake
2021-06-07  2:08 ` Dmitry Gutov
2022-07-15 11:48   ` Lars Ingebrigtsen
2022-07-15 13:09     ` Stephen Leake
2022-11-20 22:17 ` bug#48747: " Stephen Leake
2022-11-20 22:57   ` Dmitry Gutov [this message]
2022-11-21 18:59     ` bug#48747: [SPAM UNSURE] " Stephen Leake
2022-11-22  2:41       ` Dmitry Gutov
2022-11-22 19:02         ` Stephen Leake
2022-11-22 22:20           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b4aded1-5dda-25c8-8144-71aa9727353c@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=48747@debbugs.gnu.org \
    --cc=stephen_leake@stephe-leake.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).