From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68547: [PATCH] ; Fix 'mode-line-format-right-align' with ElDoc Date: Sat, 20 Jan 2024 11:58:25 +0100 Message-ID: References: <83cytwtjiw.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12841"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , 68547@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 20 11:59:13 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 1rR94B-00031B-Ab for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Jan 2024 11:59:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rR941-0001wM-MI; Sat, 20 Jan 2024 05:59:01 -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 1rR93z-0001w8-Vl for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 05:58:59 -0500 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 1rR93z-00010z-MG for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 05:58:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rR942-0000gg-6t for bug-gnu-emacs@gnu.org; Sat, 20 Jan 2024 05:59:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jan 2024 10:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68547 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 68547-submit@debbugs.gnu.org id=B68547.17057483132596 (code B ref 68547); Sat, 20 Jan 2024 10:59:02 +0000 Original-Received: (at 68547) by debbugs.gnu.org; 20 Jan 2024 10:58:33 +0000 Original-Received: from localhost ([127.0.0.1]:32967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rR93Y-0000fn-IU for submit@debbugs.gnu.org; Sat, 20 Jan 2024 05:58:32 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:58918 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rR93W-0000ff-M7 for 68547@debbugs.gnu.org; Sat, 20 Jan 2024 05:58:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1705748307; bh=A8o4ROldKXjWXkKnkMWOs2gkqpCeOCpJc4W4YS0U8mY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QOGm1eoNzQe2MY4HJ4PyyqBKqwDurJxz1XBYFkt80FhqIAbO2pa6WUKerWFN9InVv e9kV6oe6VD69/ohfS/lxLym6+xgILBr60hlH/Zr3yo6/bQLFbN0TMBvBvwEti4UvyC A8uuvOtIqs2BPDFgXv2LvxTxc0PIEczEvqiDhvCL4zgf9DIqCHrRAeOnLOqJSfUQV/ 7UiSEh0892ySxrSnupMCC/o0CJP5RE/JCb7ibdx3lKcj6NfDp9YdYvT4s74g3jbiFh SyIaeIxmzdEL9toF9J7EqIiVmM0UFKCXSoBRjVEYz0kgNQtIrANmtsnQLp9QZBU5gB 4Adi7AhvQ/QhA== In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sat, 20 Jan 2024 10:20:39 +0000") 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:278595 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jo=C3=A3o T=C3=A1vora writes: > On Sat, Jan 20, 2024 at 9:57=E2=80=AFAM Eli Zaretskii wrot= e: >> >> > Date: Wed, 17 Jan 2024 20:44:04 +0100 >> > From: Eshel Yaron via "Bug reports for GNU Emacs, >> > the Swiss army knife of text editors" >> > >> > Tags: patch >> > >> > The new mode line right alignment requires setting `mode-line-format` = to >> > a list that contains (as in `memq`) the symbol >> > `mode-line-format-right-align`. This is a bit brittle, and currently >> > `eldoc-minibuffer-message` modifies `mode-line-format` in a way that >> > happens to break `mode-line-format-right-align`. To see that, set >> > `mode-line-format` to '("" mode-line-format-right-align "foo bar") and >> > then type `M-: (list`. Now ElDoc info appears on the mode line, but >> > "bar" is no longer visible. >> > >> > This patch makes ElDoc modify `mode-line-format` in an equivalent way >> > that avoids messing with `mode-line-format-right-align`. >> >> Thanks. >> >> Jo=C3=A3o, any objections or comments? > > I think it looks good. I just think the patch is a little > too newline friendly, i.e. the if can probably fit in a single > line without reaching 80 columns and it'll make it easier to > read. Yes, it fits nicely. See updated patch below. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v2-0001-Fix-mode-line-format-right-align-with-ElDoc-Bug-6.patch >From 9c69e20ed172a2bfa56056a62077ae1c68b9b979 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 1 Jan 2024 22:14:59 +0100 Subject: [PATCH v2] ; Fix 'mode-line-format-right-align' with ElDoc (Bug#68547) * lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Avoid nesting 'mode-line-format', since that breaks 'mode-line-format-right-align'. --- lisp/emacs-lisp/eldoc.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 06970d40e8a..912a7357ca7 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -312,9 +312,11 @@ eldoc-minibuffer-message (not (and (listp mode-line-format) (assq 'eldoc-mode-line-string mode-line-format)))) (setq mode-line-format - (list "" '(eldoc-mode-line-string - (" " eldoc-mode-line-string " ")) - mode-line-format))) + (funcall + (if (listp mode-line-format) #'append #'list) + (list "" '(eldoc-mode-line-string + (" " eldoc-mode-line-string " "))) + mode-line-format))) (setq eldoc-mode-line-string (when (stringp format-string) (apply #'format-message format-string args))) -- 2.42.0 --=-=-=--