From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Add cl-defgeneric project-name; first use case eglot Date: Mon, 21 Nov 2022 15:07:49 +0200 Message-ID: <83a64k4fru.fsf@gnu.org> References: <86zgcll1le.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7128"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, joaotavora@gmail.com To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 21 14:08:29 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ox6XF-0001eI-1A for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Nov 2022 14:08:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ox6WU-0001Lb-GC; Mon, 21 Nov 2022 08:07:42 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox6WR-0001G1-RL for emacs-devel@gnu.org; Mon, 21 Nov 2022 08:07:40 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox6WR-0008Ot-2Q; Mon, 21 Nov 2022 08:07:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=3MYG4EKoQCEfHdww1ExhEc4nIOX0VHFCvbEfRdv6XJ4=; b=J5mOUO1zrb+HftOonc40 V3VKDRaFrsi8QX2NOndhZEPuFb0HoJm54zGiYlAD/4o3NbxtWHRFToGuAkrLISukummQxWr1NZClZ +D/dX4MSJdReB4kqPjeyvmV5UGKzlxDAkGeWRJApPFM6+p81hZloFpeWkfKXa0ZP3zp93kVPdygTy uAsjZFLJwsw5xD+JW2Jpv/64x98NKstLcyGDYyUj+FoSq0NFjIU+Fz66dasC1sdrNfzRHzdnh2BOp 4JZRgBsFb2/6WqJRtRnrU4hzP/grN5KopP6nQPpG9OZQECRbzvPRtKSS1X50iYFuNv4GD3gBEA3Fk hAjgj1CVlCUQfg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ox6WQ-0001fK-HO; Mon, 21 Nov 2022 08:07:38 -0500 In-Reply-To: <86zgcll1le.fsf@stephe-leake.org> (message from Stephen Leake on Sun, 20 Nov 2022 14:09:49 -0800) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:300292 Archived-At: > From: Stephen Leake > Cc: João Távora > 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.