unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Add cl-defgeneric project-name; first use case eglot
@ 2022-11-20 22:09 Stephen Leake
  2022-11-20 22:14 ` [SPAM UNSURE] " Stephen Leake
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Stephen Leake @ 2022-11-20 22:09 UTC (permalink / raw)
  To: emacs-devel; +Cc: João Távora

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"

There are probably other situations where providing a more meaningful
name for a project would be useful.

So I'd like to add a new cl-defgeneric to project.el:

(cl-defgeneric project-name (project)
  "A human-readable name for the project."
  (file-name-base (directory-file-name (project-root project))))

Then I can override that in my projects, and eglot will use my desired
name.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-11-28  1:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-20 22:09 Add cl-defgeneric project-name; first use case eglot Stephen Leake
2022-11-20 22:14 ` [SPAM UNSURE] " Stephen Leake
2022-11-21  0:37 ` Stephen Leake
2022-11-21 13:07 ` Eli Zaretskii
2022-11-21 13:50   ` João Távora
2022-11-21 14:17     ` Eli Zaretskii
2022-11-21 21:29       ` João Távora
2022-11-22  9:56   ` Kévin Le Gouguec
2022-11-23  2:34     ` Dmitry Gutov
2022-11-23  8:33       ` Juri Linkov
2022-11-23 13:46         ` Dmitry Gutov
2022-11-27 18:47       ` Kévin Le Gouguec
2022-11-28  1:21         ` Dmitry Gutov

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