From: Andrii Kolomoiets Date: Thu, 23 Apr 2020 07:44:12 +0000 (+0300) Subject: Hide eldoc-message on empty hover info X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~237 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=60914d2ca402a26f099ab27564611bb4d7e22e67;p=emacs.git Hide eldoc-message on empty hover info Co-authored-by: João Távora * eglot.el (eglot-eldoc-function): Pass nil to eglot--update-doc on empty hover info. (eglot--update-doc): Skip update eglot help buffer if string is nil. GitHub-reference: close https://github.com/joaotavora/eglot/issues/439 --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 13571d4315c..c485b4e2ddd 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2259,10 +2259,12 @@ Buffer is displayed with `display-buffer', which obeys (defun eglot--update-doc (string hint) "Put updated documentation STRING where it belongs. Honours `eglot-put-doc-in-help-buffer'. HINT is used to -potentially rename EGLOT's help buffer." - (if (or (eq t eglot-put-doc-in-help-buffer) - (and eglot-put-doc-in-help-buffer - (funcall eglot-put-doc-in-help-buffer string))) +potentially rename EGLOT's help buffer. If STRING is nil, the +echo area cleared of any previous documentation." + (if (and string + (or (eq t eglot-put-doc-in-help-buffer) + (and eglot-put-doc-in-help-buffer + (funcall eglot-put-doc-in-help-buffer string)))) (with-current-buffer (eglot--help-buffer) (let ((inhibit-read-only t) (name (format "*eglot-help for %s*" hint))) @@ -2314,10 +2316,10 @@ potentially rename EGLOT's help buffer." :success-fn (eglot--lambda ((Hover) contents range) (unless sig-showing (when-buffer-window - (when-let (info (and (not (seq-empty-p contents)) - (eglot--hover-info contents - range))) - (eglot--update-doc info thing-at-point))))) + (eglot--update-doc (and (not (seq-empty-p contents)) + (eglot--hover-info contents + range)) + thing-at-point)))) :deferred :textDocument/hover)) (when (eglot--server-capable :documentHighlightProvider) (jsonrpc-async-request