how to make the minibuffer grow when invoking eldoc
with eldoc-display-in-echo-area
enabled
#1458
-
Hi all, I use the following (add-hook
'eglot-managed-mode-hook
(lambda ()
;; we want eglot to setup callbacks from eldoc, but we don't want eldoc
;; running after every command. So we disable it after we just enabled it.
(eldoc-mode -1)))
(defun eldoc-fancy (arg)
"`eldoc' but uses the echo area by default and a prefix will swap to a buffer."
;; https://github.com/joaotavora/eglot/discussions/1328
(interactive "P")
(let (_)
(defvar eldoc-display-functions)
(setq eldoc-display-functions
(if arg '(eldoc-display-in-buffer) '(eldoc-display-in-echo-area)))
(eldoc t))) However, even though I use the default When I prefix my command and therefore force it to use Here's an example of something I see from the
but when I see this in the echo area it only gives me the first line. Notably there is no truncation message here (as per (as an aside, if I was given the power to customise the way this is truncated, I'd choose the last line not the first, but as a first step I'd like to be able to see everything) My full emacs config, if anybody is so inclined to dig deeper, is https://gitlab.com/fommil/dotfiles/-/tree/master/.emacs.d |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I think Therefore, what you possibly want is to replace one of Eglot's documentation functions with one of your own doing: (defun my/special-eglot-hover-function (cb)
"Same as `eglot-hover-eldoc-function`, but throw away its short :echo cookie"
(eglot-hover-eldoc-function (lambda (info &rest _ignore)
;; ignore the :echo cookie that eglot-hover-eldoc-function offers
(funcall cb info))))
(add-hook
'eglot-managed-mode-hook
(lambda ()
(setq-local eldoc-documentation-functions (cl-substitute #'my/special-eglot-hover-function 'eglot-hover-eldoc-function eldoc-documentation-functions))
;; we want eglot to setup callbacks from eldoc, but we don't want eldoc
;; running after every command. So we disable it after we just enabled it.
(eldoc-mode -1))) |
Beta Was this translation helpful? Give feedback.
I think
eldoc-display-in-echo-area
, the display function, is already setup to display the "short" version of each documentation function ineldoc-documentation-functions
(there may be many, and Eglot normally uses 3) .eldoc-display-in-buffer
is not and it displays the full version. Soeldoc-display-in-echo-area
displays multiple short versions of each doc function, and it is that pre-filtered whole that honourseldoc-echo-area-use-multiline-p
,not each documentation excerpt separately.Therefore, what you possibly want is to replace one of Eglot's documentation functions with one of your own doing: