2

I am unable to determine how eldoc is displaying arguments (or other information) in the mode-line while eval-expression is reading user input in the minibuffer. I could not find a relevant element in the default value of mode-line-format and I also did not find any code where eldoc is prepending an element temporarily to the (local?) value of mode-line-format.

I need this so that I can change the visual appearance, such as its background color.

Note that I did find the complex machinery that determines what information to display; that's not what I am looking for, I only wonder how that information is displayed, whatever it may be.

Drew
  • 75,699
  • 9
  • 109
  • 225
tarsius
  • 25,298
  • 4
  • 69
  • 109

1 Answers1

2

Isn't it:

(defun eldoc-minibuffer-message (format-string &rest args)
  "Display messages in the mode-line when in the minibuffer.
Otherwise work like `message'."

?

It seems that it prepends eldoc-mode-line-string to mode-line-format and clears it on a minibuffer-exit-hook:

    (add-hook 'minibuffer-exit-hook
          (lambda () (setq eldoc-mode-line-string nil
                  ;; https://debbugs.gnu.org/16920
                  eldoc-last-message nil))
          nil t)
...
        (setq mode-line-format
          (list "" '(eldoc-mode-line-string
                 (" " eldoc-mode-line-string " "))
            mode-line-format)))

It also does a (force-mode-line-update). Not a very polite way to do it, it could just have written to the global-mode-string or added its own lighter...

See how it looks with doom-modeline :(

The heading bar is displaced to the right. Fortunately moody-modeline won't be affected like this, although I don't know how well it plays with ribbons and tabs.

NOTE: all of the above is from emacs-28 branch.

memeplex
  • 399
  • 2
  • 4