From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line Date: Wed, 03 Jul 2024 09:00:43 -0400 Message-ID: References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> <86plryo064.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6743"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: sbaugh@catern.com, Eli Zaretskii , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 71823@debbugs.gnu.org, Dmitry Gutov To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 03 15:01:56 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 1sOzcP-0001Rn-Is for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Jul 2024 15:01:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOzc6-0007Lo-KP; Wed, 03 Jul 2024 09:01:42 -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 1sOzbZ-0007JU-FX for bug-gnu-emacs@gnu.org; Wed, 03 Jul 2024 09:01:01 -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 1sOzbY-00046v-Vf for bug-gnu-emacs@gnu.org; Wed, 03 Jul 2024 09:01:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sOzbZ-0008Tq-Q4 for bug-gnu-emacs@gnu.org; Wed, 03 Jul 2024 09:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Jul 2024 13:01:01 +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.172001165332578 (code B ref 71823); Wed, 03 Jul 2024 13:01:01 +0000 Original-Received: (at 71823) by debbugs.gnu.org; 3 Jul 2024 13:00:53 +0000 Original-Received: from localhost ([127.0.0.1]:39145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOzbR-0008TO-9i for submit@debbugs.gnu.org; Wed, 03 Jul 2024 09:00:53 -0400 Original-Received: from mxout6.mail.janestreet.com ([64.215.233.21]:34127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOzbP-0008TA-Fp for 71823@debbugs.gnu.org; Wed, 03 Jul 2024 09:00:52 -0400 In-Reply-To: <86plryo064.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 30 Jun 2024 19:38:59 +0300") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1720011643; bh=N3a9IWa6Qe5kg96iszghyNrIh06sIDNhaC0EIGIcUf4=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GI7YzGZvJpfHDwhuWd6wvBjC4W6Qdc3fnfO0pXGRRbqZBWIC2t4TysWNEtFN8vm/v jOre8M1xHm05+YQ6o5qoJ8i+eDZvRuLgjyXIU1XW+1g3SJ2i5c9lQouSVx3fb009xo ngNvWQvc1dJuNmLNX2Ls1ITZ0d6dzYGa2iEXXMH6OfHfFhn/jrOOkOX0Yqr/BN41su qu4otTAPj4FTjbKRQV8yidKqR7N0QPFVTN6ErhcgBcsUivirDZ8RERCu8YGe3KhRmF A3rM3ExJZLgy6wgWzzIw6AqEZlZb815SEvRhZH5pFYOt/txjnw+5h1DWpmA999sPJU kF60f6K5G/Ffg== 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:288315 Archived-At: Juri Linkov writes: >> 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. Will do that in the next version of the patch. > 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). I was also unsure, but after thinking about it, I think it's actually quite reasonable, for this reason: anyone enabling eglot already had project-name in their modeline. This patch just moves the project-name from the [eglot] element to a separate mode-line element. So this doesn't actually change the contents of an eglot user's mode-line, just the order of the elements. Plus the separate element has the mouse-1 project menu, which is a nice addition.