Fix: meesed up minor modes

Because at-point mode uses hover mode, disabling each other
doesn't work.
This commit is contained in:
Yuan Fu 2018-12-31 00:54:32 -05:00
parent f5e15dbf09
commit 0278b46f7e
No known key found for this signature in database
GPG Key ID: 1CF5ECABEC37A901
2 changed files with 4 additions and 4 deletions

View File

@ -13,6 +13,8 @@ Get the file, add to load path, and
** Function ** 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. 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-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) - =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 ** Face

View File

@ -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." "Displays hover documentations in a childframe. This mode is buffer local."
:lighter " ELDOC-BOX" :lighter " ELDOC-BOX"
(if eldoc-box-hover-mode (if eldoc-box-hover-mode
(progn (eldoc-box-hover-at-point-mode -1) (progn (add-function :before-until (local 'eldoc-message-function)
(add-function :before-until (local 'eldoc-message-function)
#'eldoc-box--eldoc-message-function) #'eldoc-box--eldoc-message-function)
(when eldoc-box-clear-with-C-g (when eldoc-box-clear-with-C-g
(advice-add #'keyboard-quit :before #'eldoc-box-quit-frame))) (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." You can use C-g to hide the doc."
:lighter "" :lighter ""
(if eldoc-box-hover-at-point-mode (if eldoc-box-hover-at-point-mode
(progn (eldoc-box-hover-mode -1) (progn (setq-local
(setq-local
eldoc-box-position-function eldoc-box-position-function
#'eldoc-box--default-at-point-position-function) #'eldoc-box--default-at-point-position-function)
(setq-local eldoc-box-clear-with-C-g t) (setq-local eldoc-box-clear-with-C-g t)