From 0278b46f7e6dff3b2bf30a731785c4d68add8842 Mon Sep 17 00:00:00 2001 From: Yuan Fu Date: Mon, 31 Dec 2018 00:54:32 -0500 Subject: [PATCH] Fix: meesed up minor modes Because at-point mode uses hover mode, disabling each other doesn't work. --- README.org | 2 ++ eldoc-box.el | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 70cfdb3..f653304 100644 --- a/README.org +++ b/README.org @@ -13,6 +13,8 @@ Get the file, add to load path, and ** 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) ** Face diff --git a/eldoc-box.el b/eldoc-box.el index 38302d4..de22e10 100644 --- a/eldoc-box.el +++ b/eldoc-box.el @@ -127,8 +127,7 @@ It will be passes with two arguments: WIDTH and HEIGHT of the childframe.") "Displays hover documentations in a childframe. This mode is buffer local." :lighter " ELDOC-BOX" (if eldoc-box-hover-mode - (progn (eldoc-box-hover-at-point-mode -1) - (add-function :before-until (local 'eldoc-message-function) + (progn (add-function :before-until (local 'eldoc-message-function) #'eldoc-box--eldoc-message-function) (when eldoc-box-clear-with-C-g (advice-add #'keyboard-quit :before #'eldoc-box-quit-frame))) @@ -146,8 +145,7 @@ It will be passes with two arguments: WIDTH and HEIGHT of the childframe.") You can use C-g to hide the doc." :lighter "" (if eldoc-box-hover-at-point-mode - (progn (eldoc-box-hover-mode -1) - (setq-local + (progn (setq-local eldoc-box-position-function #'eldoc-box--default-at-point-position-function) (setq-local eldoc-box-clear-with-C-g t)