A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01388.html below:

Re: Add cl-defgeneric project-name; first use case eglot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] From: Eli Zaretskii Subject: Re: Add cl-defgeneric project-name; first use case eglot Date: Mon, 21 Nov 2022 15:07:49 +0200
> From: Stephen Leake <stephen_leake@stephe-leake.org>
> Cc: João Távora <joaotavora@gmail.com>
> Date: Sun, 20 Nov 2022 14:09:49 -0800
> 
> 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.

So Eglot should allow customization of what is shown on the mode line.

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

I don't see why the needs of Eglot usage justify another generic in
project.el, or should be solved in project.el to begin with.  If Dmitry
wants to add such a generic for his own reasons, with some future
development of project.el in mind, I won't object, of course.  Otherwise, it
sounds like the wrong way of solving specific problems: by generalizing the
heck out of them.  E.g., tomorrow we decide that Eglot shouldn't use the
project name on the mode line, and puff! your solution evaporates.



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4