From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line Date: Sun, 30 Jun 2024 19:38:59 +0300 Organization: LINKOV.NET Message-ID: <86plryo064.fsf@mail.linkov.net> References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="309"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: Spencer Baugh , Eli Zaretskii , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 71823@debbugs.gnu.org, Dmitry Gutov To: sbaugh@catern.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 30 18:41:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sNxc4-000ATp-3l for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 Jun 2024 18:41:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNxby-0002hB-2W; Sun, 30 Jun 2024 12:41:10 -0400 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 1sNxbq-0002fF-GX for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2024 12:41:04 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNxbq-0006FD-60 for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2024 12:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sNxbq-0003uC-46 for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2024 12:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Jun 2024 16:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71823 X-GNU-PR-Package: emacs Original-Received: via spool by 71823-submit@debbugs.gnu.org id=B71823.171976562314954 (code B ref 71823); Sun, 30 Jun 2024 16:41:02 +0000 Original-Received: (at 71823) by debbugs.gnu.org; 30 Jun 2024 16:40:23 +0000 Original-Received: from localhost ([127.0.0.1]:58847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNxbD-0003t8-Ej for submit@debbugs.gnu.org; Sun, 30 Jun 2024 12:40:23 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:32811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNxbB-0003su-De for 71823@debbugs.gnu.org; Sun, 30 Jun 2024 12:40:21 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id E98A0FF802; Sun, 30 Jun 2024 16:39:52 +0000 (UTC) In-Reply-To: <87jzi6fvar.fsf@catern.com> (sbaugh@catern.com's message of "Sun, 30 Jun 2024 12:51:25 +0000 (UTC)") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288210 Archived-At: > I do think this is a great way to resolve this - now that > project-mode-line exists, using it deletes one small bit of > eglot-specific functionality, which is in line with the Eglot design > philosophy. > > The only issue is that this was only added to mode-line-format in Emacs > 30, so we can only use it in Emacs 30 or later. > > The attached patch detects that with: > > + (when (member '(project-mode-line project-mode-line-format) mode-line-format) > > but I'm also totally fine with: > > + (when (version<= "30" emacs-version) > > Or I guess we could sidestep the issue if project.el itself ensured, > when loaded, that mode-line-format contains project-mode-line. eglot > itself does this with eglot--mode-line-format, running the following at > load time: > > (add-to-list 'mode-line-misc-info > `(eglot--managed-mode (" [" eglot--mode-line-format "] "))) > > Juri, any opinion? bindings.el already contains '(project-mode-line project-mode-line-format), so checking this with (member '(project-mode-line project-mode-line-format) mode-line-format) looks fine. OTOH, I'm not sure if using (setq-local project-mode-line t) would be appreciated by users. I think your initial patch was more correct with (bound-and-true-p project-mode-line).