Eldoc: play nice with mode-line-format-right-align (bug#68547)
authorEshel Yaron <me@eshelyaron.com>
Sat, 20 Jan 2024 11:43:27 +0000 (05:43 -0600)
committerJoão Távora <joaotavora@gmail.com>
Sat, 20 Jan 2024 12:00:21 +0000 (06:00 -0600)
* 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

index 06970d40e8a6a0be783d6ed6b9f3f9183750b2a1..912a7357ca7a228759c924614576345120ff5b0e 100644 (file)
@@ -312,9 +312,11 @@ Otherwise, it displays the message like `message' would."
                      (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)))