]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix 'mode-line-format-right-align' with ElDoc
authorEshel Yaron <me@eshelyaron.com>
Mon, 1 Jan 2024 21:14:59 +0000 (22:14 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 1 Jan 2024 21:14:59 +0000 (22:14 +0100)
* 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 4ee825136c9d44c3864dc2c3fb13ef74f3001a38..a4faa25fd31b05e0c2d24133d31e905e3b6cc0e3 100644 (file)
@@ -312,9 +312,13 @@ 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)))