GNU bug report logs - #68547
[PATCH] ; Fix 'mode-line-format-right-align' with ElDoc

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Eshel Yaron <me@HIDDEN>; Keywords: patch; dated Wed, 17 Jan 2024 19:45:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 68547 <at> debbugs.gnu.org:


Received: (at 68547) by debbugs.gnu.org; 20 Jan 2024 12:02:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 20 07:02:10 2024
Received: from localhost ([127.0.0.1]:33095 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rRA37-0007pR-8s
	for submit <at> debbugs.gnu.org; Sat, 20 Jan 2024 07:02:10 -0500
Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:57606)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1rRA35-0007kw-Ba
 for 68547 <at> debbugs.gnu.org; Sat, 20 Jan 2024 07:02:08 -0500
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-50e766937ddso1987944e87.3
 for <68547 <at> debbugs.gnu.org>; Sat, 20 Jan 2024 04:02:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1705752118; x=1706356918; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=W5tYt4hrprHvvuTKGDdRVFPW7TenRME8IJ23alEp2vM=;
 b=DY6rHwspDBzS/frsFiPGBAQWJQjzgDXMKvdqsBTzoLFSb40VdBVJbmokOFSOgdYhrQ
 /+kHys9zGnDAJ2kLbffigTdaltXeydryu5yh3EaTjSrnQn6YWu3f0foyQDoPVvUV8fqX
 UkjCgnFGHg1/zCk9WolRuKm001Lv6jH75rJIqvlQebL9pK9IgUqnFUiu5o1f92LUwXlk
 5QGuG9vBmkA49bzIEiIdfyE51+FXVrbyb3Bv78m/6ryvOf23aC3smbkzoL6mcVOVeCCS
 1hTVBg+HxQHnOdghAA7iJoDpKbvcOwp7V8Sagn/onuuYdWi3gW8sW3qkiM3DNEOTWLcb
 F9Kw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1705752118; x=1706356918;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=W5tYt4hrprHvvuTKGDdRVFPW7TenRME8IJ23alEp2vM=;
 b=msHnb5q2JGOfdR5NSpjp2I9d2on8unPbv1ETLGMRGpnpMIkgv1kWwj/Ub0i27SVzL0
 Pktuw6dyTXVhkpaW5PlgiAHHmBITKZNq7zO2YqgiB+bdoeZEn0sC6QPmkzU1JIlmsXl2
 eeekC/KTEbHVEO7ot/wYskTpKYqzeeShs/91NVvgvrL47VyGggnCC9V3MFZDkhl/mARd
 wj7CriAmknueAi5Vq5xk3XSpNBIv0uzpwzBm7eM9Z1pB1B3sLMRTgFRp702FhOLYbCoB
 4YL3roXbN1iqGe64GtjnwFbhD7QHoEhapVH1lysXJVl5UYeY7st8yiKd+GjB6WDAMyQP
 Z5qQ==
X-Gm-Message-State: AOJu0Yzswfk+oFAoHcl7FlTeDFoQHsm4WT5jJmfwJxHh18mQy7BoBF0S
 x/f4ML8nPMv7/3ODfCXTiTGHtnEnbvOTICrxURf1dYZgzv/xL7WXDBpyRa45nfdWGACm/7y3S9Q
 iLwaY9V34ld0jRVKcMzyBxVal3t8=
X-Google-Smtp-Source: AGHT+IE9po3C+sZEFkc/bkIuU5+YzjVc6zRcrEzFQAZfttMmgdzfPqocVRHrMzln2v3vze1iyxr23bSETDjIvAClja8=
X-Received: by 2002:a05:6512:550:b0:50e:4bf6:8848 with SMTP id
 h16-20020a056512055000b0050e4bf68848mr438879lfl.38.1705752118338; Sat, 20 Jan
 2024 04:01:58 -0800 (PST)
MIME-Version: 1.0
References: <m14jfbg2yj.fsf@HIDDEN> <83cytwtjiw.fsf@HIDDEN>
 <CALDnm53Z4LppG7AUej2W5qrD_8MyA6YmYvZFFOpK5ULfv62j_w@HIDDEN>
 <m1edec9sq6.fsf@HIDDEN>
In-Reply-To: <m1edec9sq6.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Sat, 20 Jan 2024 12:01:46 +0000
Message-ID: <CALDnm50RA9ph-Dm8sWy7vzBm7y_0qqauM4AU6V7iB6FKgxeTXw@HIDDEN>
Subject: Re: bug#68547: [PATCH] ; Fix 'mode-line-format-right-align' with ElDoc
To: Eshel Yaron <me@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68547
Cc: Eli Zaretskii <eliz@HIDDEN>, 68547 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sat, Jan 20, 2024 at 10:58=E2=80=AFAM Eshel Yaron <me@HIDDEN> wr=
ote:
>
> Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN> writes:
>
> > On Sat, Jan 20, 2024 at 9:57=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wr=
ote:
> >>
> >> > 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" <bug-gnu-emacs@HIDDEN>
> >> >
> >> > 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 currentl=
y
> >> > `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") a=
nd
> >> > 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 wa=
y
> >> > 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.

Thanks.  I pushed it.  I'm going to look at this function though,
since I don't I love the logic of destroying any old buffer's
mode-line-format and not restoring after the minibuffer is
exited.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68547; Package emacs. Full text available.

Message received at 68547 <at> debbugs.gnu.org:


Received: (at 68547) by debbugs.gnu.org; 20 Jan 2024 10:58:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 20 05:58:32 2024
Received: from localhost ([127.0.0.1]:32967 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rR93Y-0000fn-IU
	for submit <at> debbugs.gnu.org; Sat, 20 Jan 2024 05:58:32 -0500
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 <me@HIDDEN>) id 1rR93W-0000ff-M7
 for 68547 <at> 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==
From: Eshel Yaron <me@HIDDEN>
To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Subject: Re: bug#68547: [PATCH] ; Fix 'mode-line-format-right-align' with ElDoc
In-Reply-To: <CALDnm53Z4LppG7AUej2W5qrD_8MyA6YmYvZFFOpK5ULfv62j_w@HIDDEN>
 (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Sat, 20 Jan 2024
 10:20:39 +0000")
References: <m14jfbg2yj.fsf@HIDDEN> <83cytwtjiw.fsf@HIDDEN>
 <CALDnm53Z4LppG7AUej2W5qrD_8MyA6YmYvZFFOpK5ULfv62j_w@HIDDEN>
Date: Sat, 20 Jan 2024 11:58:25 +0100
Message-ID: <m1edec9sq6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68547
Cc: Eli Zaretskii <eliz@HIDDEN>, 68547 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Jo=C3=A3o T=C3=A1vora <joaotavora@HIDDEN> writes:

> On Sat, Jan 20, 2024 at 9:57=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> 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" <bug-gnu-emacs@HIDDEN>
>> >
>> > 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 <me@HIDDEN>
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


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68547; Package emacs. Full text available.

Message received at 68547 <at> debbugs.gnu.org:


Received: (at 68547) by debbugs.gnu.org; 20 Jan 2024 10:21:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 20 05:21:00 2024
Received: from localhost ([127.0.0.1]:32931 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rR8TE-0002lH-Ak
	for submit <at> debbugs.gnu.org; Sat, 20 Jan 2024 05:21:00 -0500
Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:51684)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <joaotavora@HIDDEN>) id 1rR8TD-0002l2-9d
 for 68547 <at> debbugs.gnu.org; Sat, 20 Jan 2024 05:20:59 -0500
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-50edf4f478eso2090479e87.3
 for <68547 <at> debbugs.gnu.org>; Sat, 20 Jan 2024 02:20:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1705746050; x=1706350850; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=EfXe87u4YvlethQXMy5E48bGARbf4PNpxb0h87jmWvU=;
 b=mm6H4VLYg2uc29gyVSd2VEsb26iO1aWtYCIedfXPWMIsWeO57zeVLTTmuRsTX6e4rw
 DGYt1p2tnBxhdwQj95S9J6mSmsSQE71aRTET020xSlyOsVUUD2GLZ9P+8TmeKBvuQlIG
 FjSWBIt0tN/ZGG9kRM+s7ikod1uYjAiARwv4L7TgYPqdYAViicAMTdOO9z1afXBUONQ0
 g8ThWECcpLp59hPj3AHrlMRAPyee79i9gDzjrOL4uEeTSAf00ZuHyvinqnQz/THMtCxI
 xhUsdBXzgDKrvubOcrWVZj1xCbDIiqigXxpbXRFw27nbu/kxiRfFcYPYmnpKBw7b+rJq
 OBug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1705746050; x=1706350850;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=EfXe87u4YvlethQXMy5E48bGARbf4PNpxb0h87jmWvU=;
 b=thXyhi3vzw57TAF2FGwORh4szDKzSkfhIZ1QPqFYqPQi/9f5eN+lj5GIi+uVf+miBB
 dfCc5Wwk2XPIKvkrJmsidh6QTdRE5yr41jjLDmIm3VWOfYgr8zhEVyYSbFkpFUWv8kn+
 eLTsZZN7OeueWFvm7D1kQUMjvZdWfDsRRlNikTVtv/gsfXx4+aUyLrUPIVZumHihk89f
 E8wGit15f9rR8hiWr6YP+UP84R9pEZpPbtI5zWDTIL8P7kc627xEEiLmDYsdxz7P9ypj
 aYvuK6rcxdim1flIGi1eBXDk4UbQh+oQ80t4GcyrcGTkKNo6oHtJvhola2CAFbNAWaGe
 rSTg==
X-Gm-Message-State: AOJu0YwcoPy1pZJ5jNQ/BVxJZISRHgdIS+oO9zQ2ZQhM0RGsOXYkbcnh
 ldfeo/VRiXwkYaOwKnWuJJgMF3eNrq5NXuVViv/e3Hau4D8o43k+vB7hew2cvoaPA1dEtfOIlI3
 e3wEUz+G2zzM0IdqdoOJgjFBXups=
X-Google-Smtp-Source: AGHT+IGvesOG6ydC+LkPu66rd6OeOA8PDhMV3voZZIvZ1MTHzD/NKZNKlszcsj0oMfwPSxRsx2dPkBgAw8Xk8PbFwHw=
X-Received: by 2002:a05:6512:554:b0:50e:42d7:21fa with SMTP id
 h20-20020a056512055400b0050e42d721famr461631lfl.107.1705746050363; Sat, 20
 Jan 2024 02:20:50 -0800 (PST)
MIME-Version: 1.0
References: <m14jfbg2yj.fsf@HIDDEN> <83cytwtjiw.fsf@HIDDEN>
In-Reply-To: <83cytwtjiw.fsf@HIDDEN>
From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= <joaotavora@HIDDEN>
Date: Sat, 20 Jan 2024 10:20:39 +0000
Message-ID: <CALDnm53Z4LppG7AUej2W5qrD_8MyA6YmYvZFFOpK5ULfv62j_w@HIDDEN>
Subject: Re: bug#68547: [PATCH] ; Fix 'mode-line-format-right-align' with ElDoc
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68547
Cc: Eshel Yaron <me@HIDDEN>, 68547 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Sat, Jan 20, 2024 at 9:57=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wrote:
>
> > 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" <bug-gnu-emacs@HIDDEN>
> >
> > Tags: patch
> >
> > The new mode line right alignment requires setting `mode-line-format` t=
o
> > 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.

Jo=C3=A3o




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68547; Package emacs. Full text available.

Message received at 68547 <at> debbugs.gnu.org:


Received: (at 68547) by debbugs.gnu.org; 20 Jan 2024 09:57:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 20 04:57:25 2024
Received: from localhost ([127.0.0.1]:60900 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rR86P-0004z1-HQ
	for submit <at> debbugs.gnu.org; Sat, 20 Jan 2024 04:57:25 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:58976)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1rR86O-0004yo-GH
 for 68547 <at> debbugs.gnu.org; Sat, 20 Jan 2024 04:57:24 -0500
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 <eliz@HIDDEN>)
 id 1rR86G-0000TX-9C; Sat, 20 Jan 2024 04:57:16 -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=wOjj8QgOMz+KPzXIrhIEgU75ddZZYUKU/rZeNJRPXz0=; b=l7o+IUAUsH21xZKZP8lX
 8F4uFEqVKTU2qMDyo1+lhZvwpb4o2RbDtLzAaZITmXtcoj2qUqf9O7YLaaqYt7lxfJBM5s8F4L2Uk
 PkVc9BeMHkEbrU6LRFWQ6jZnS9xW9be80dYuKVBy2uN70wIxSp6iEErHhYchu28ZqNOSV4uRaJx1H
 41EZ3iqdabQJGqVN3TLPKdLnSTSHAc854QlQ98jqZzxO5Jtvt0lOv4VSqr/A2rRaEqwbUUCATruZ+
 w8kgbcR4XTN3EgUo05lbHl7ydS2OsQhBGWGstBuTnB5P5nkuwyNC+ymxbOc7Pbc7GXcXSpQIoHCk3
 MEWpK4ZmGm3bzg==;
Date: Sat, 20 Jan 2024 11:56:55 +0200
Message-Id: <83cytwtjiw.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Eshel Yaron <me@HIDDEN>, =?iso-8859-1?Q?Jo=E3o_T=E1vora?=
 <joaotavora@HIDDEN>
In-Reply-To: <m14jfbg2yj.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#68547: [PATCH] ; Fix 'mode-line-format-right-align' with ElDoc
References: <m14jfbg2yj.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68547
Cc: 68547 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> 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" <bug-gnu-emacs@HIDDEN>
> 
> 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ćo, any objections or comments?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#68547; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Jan 2024 19:44:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 17 14:44:18 2024
Received: from localhost ([127.0.0.1]:53541 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rQBpi-0007Mr-1D
	for submit <at> debbugs.gnu.org; Wed, 17 Jan 2024 14:44:18 -0500
Received: from lists.gnu.org ([2001:470:142::17]:42716)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <me@HIDDEN>) id 1rQBpf-0007Mb-Oc
 for submit <at> debbugs.gnu.org; Wed, 17 Jan 2024 14:44:16 -0500
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 <me@HIDDEN>) id 1rQBpY-0003Cc-MB
 for bug-gnu-emacs@HIDDEN; Wed, 17 Jan 2024 14:44:08 -0500
Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1rQBpX-0004rP-3p
 for bug-gnu-emacs@HIDDEN; Wed, 17 Jan 2024 14:44:08 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com;
 s=mail; t=1705520646;
 bh=7Sfei4ztzVKngsz6oVkXcj/6/zIEMOe0uffJCIADVp4=;
 h=From:To:Subject:Date:From;
 b=mOOaYG0Wp/iFdOBe5wWE+iQSHsR7L4iwQg/OWoXrbYXAd7oWMP/YKAwP97wzVPaO/
 q8P8Iq2oAKwg/V0TIi7bk8Sjo4DHU8wHEWY9AacexBXyOZPBuG55VPFrFyJp7NltNo
 m2paJA2CNSN6yYxkGUlnvlAX5iTM/wVmlGwOWEsmP3s6sDUOz6f5ZPnixhLFHopFe1
 dC9oOZWDZQYB4Iu7RVgQ+UbiSsvXELbQtKZrw68eSQkFJ4EqSIIUG5lsc6Jwh/luWh
 zR9YeQYgSc9ucj8p88RIzkzWThJI6b8T31HlX/NVqzl4Sc0tjgFpjyMgOshufBEj0j
 ix4JfM/Gsdplw==
From: Eshel Yaron <me@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] ; Fix 'mode-line-format-right-align' with ElDoc
X-Hashcash: 1:20:240117:bug-gnu-emacs@HIDDEN::5LAWlTBilvOqUJ7p:05no
Date: Wed, 17 Jan 2024 20:44:04 +0100
Message-ID: <m14jfbg2yj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@HIDDEN;
 helo=eshelyaron.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

--=-=-=
Content-Type: text/plain

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


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-Fix-mode-line-format-right-align-with-ElDoc.patch

From 5d8568e00c2c36ce2fbc7554635868826ec5009a Mon Sep 17 00:00:00 2001
From: Eshel Yaron <me@HIDDEN>
Date: Mon, 1 Jan 2024 22:14:59 +0100
Subject: [PATCH] ; Fix 'mode-line-format-right-align' with ElDoc

* 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 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 4ee825136c9..a4faa25fd31 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -312,9 +312,13 @@ 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


--=-=-=--




Acknowledgement sent to Eshel Yaron <me@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#68547; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 20 Jan 2024 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.