From 317cd2ddfc071379332ca82edc6c22004f03b661 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Tue, 11 Dec 2018 16:36:34 -0500 Subject: [PATCH] Follow ElDoc convension Instead of clearing childframe on pre-command hook, clear when display function is passed a nil argument --- eldoc-box.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/eldoc-box.el b/eldoc-box.el index b1b2d74..80115d8 100644 --- a/eldoc-box.el +++ b/eldoc-box.el @@ -74,7 +74,10 @@ (defun eldoc-box-help-at-point () "Display hover info at point in a childframe." (interactive) - (eldoc-message (funcall eldoc-documentation-function))) + (let ((doc (funcall eldoc-documentation-function))) + (when doc + (eldoc-box--display doc) + (eldoc-box--inject-quit-func)))) (defun eldoc-box-quit-frame () "Hide childframe used by eglot doc." @@ -101,8 +104,7 @@ (setq mode-line-format nil) (erase-buffer) (insert str) - (eldoc-box--get-frame doc-buffer)) - (eldoc-box--inject-quit-func))) + (eldoc-box--get-frame doc-buffer)))) (defun eldoc-box-quit-hook () "Quit eglot doc childframe and remove self from hook."