From 18829272b89829f49d709fb3aeba89cebd73f831 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Sun, 6 Jan 2019 20:54:54 -0500 Subject: [PATCH] make at-point minor mode a add-on of the other minor mode This way there is no confusion. --- README.org | 8 ++------ eldoc-box.el | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/README.org b/README.org index 51ceb30..3c67de5 100644 --- a/README.org +++ b/README.org @@ -11,13 +11,9 @@ Get the file, add to load path, and #+END_SRC * Usage ** Function -Enable either mode will make eldoc display documentation on a popup childframe. The difference is the position of the childframe — the first minor mode displays the childframe on the (left or right) upper corner, while the second displays the childframe right below point. - -Note that =eldoc-box-hover-at-point-mode= enables =eldoc-box-hover-mode= — it just adds some more configuration on top of the latter, so you want to disable “at-point” mode before switching to =eldoc-box-hover-mode=. - - =eldoc-box-hover-mode= :: Display documentation of the symbol at point in a childframe on upper corner. -- =eldoc-box-hover-at-point-mode= :: Display documentation of the symbol at point in a childframe below point. (That's what the =at-point= part mean) -- =eldox-box-eglot-help-at-point= :: See below. +- =eldoc-box-hover-at-point-mode= :: If you enable this minor mode *on top of* =eldoc-box-hover-mode=, the childframe is displayed at point, instead of on the upper corner. +- =eldox-box-eglot-help-at-point= :: [[Use with eglot][See below]] ** Face - =eldoc-box-border= :: Adjust =:background= of this face for border color. - =eldoc-box-body= :: Adjust =:background= and =:font= of this face for background color and font of the childframe. I suggest to use a nice Sans Serif font, such as Source Sans Pro. diff --git a/eldoc-box.el b/eldoc-box.el index ce38fed..ebe64c0 100644 --- a/eldoc-box.el +++ b/eldoc-box.el @@ -150,9 +150,7 @@ You can use C-g to hide the doc." #'eldoc-box--default-at-point-position-function) (setq-local eldoc-box-clear-with-C-g t) (remove-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area t) - (add-hook 'pre-command-hook #'eldoc-box-quit-frame t t) - (eldoc-box-hover-mode)) - (eldoc-box-hover-mode -1) + (add-hook 'pre-command-hook #'eldoc-box-quit-frame t t)) (add-hook 'pre-command-hook #'eldoc-pre-command-refresh-echo-area t) (remove-hook 'pre-command-hook #'eldoc-box-quit-frame t) (kill-local-variable 'eldoc-box-position-function)