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: Wed, 17 Jan 2024 20:44:04 +0100 Message-ID: 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="29376"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 68547@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 17 20:45:28 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 1rQBqp-0007RJ-QH for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Jan 2024 20:45:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQBqa-0003gz-0y; Wed, 17 Jan 2024 14:45:12 -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 1rQBqR-0003ee-4s for bug-gnu-emacs@gnu.org; Wed, 17 Jan 2024 14:45:04 -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 1rQBqP-0004xt-RC for bug-gnu-emacs@gnu.org; Wed, 17 Jan 2024 14:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rQBqQ-0007P9-MW for bug-gnu-emacs@gnu.org; Wed, 17 Jan 2024 14:45: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: Wed, 17 Jan 2024 19:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68547 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170552065828329 (code B ref -1); Wed, 17 Jan 2024 19:45:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Jan 2024 19:44:18 +0000 Original-Received: from localhost ([127.0.0.1]:53541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQBpi-0007Mr-1D for submit@debbugs.gnu.org; Wed, 17 Jan 2024 14:44:18 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:42716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rQBpf-0007Mb-Oc for submit@debbugs.gnu.org; Wed, 17 Jan 2024 14:44:16 -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 1rQBpY-0003Cc-MB for bug-gnu-emacs@gnu.org; Wed, 17 Jan 2024 14:44:08 -0500 Original-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 ) id 1rQBpX-0004rP-3p for bug-gnu-emacs@gnu.org; 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== X-Hashcash: 1:20:240117:bug-gnu-emacs@gnu.org::5LAWlTBilvOqUJ7p:05no Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; 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-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:278408 Archived-At: --=-=-= 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 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 --=-=-=--