Add warning if eldoc-box-hover-at-point-mode is enable too early

Early means eldoc-box-hover-mode is not enabled
This commit is contained in:
Yuan Fu 2019-02-10 13:06:16 -05:00
parent b9a235b61c
commit 0649423e70
No known key found for this signature in database
GPG Key ID: 1CF5ECABEC37A901

View File

@ -145,17 +145,19 @@ It will be passes with two arguments: WIDTH and HEIGHT of the childframe.")
"A convenient minor mode to display doc at point.
You can use C-g to hide the doc."
:lighter ""
(if eldoc-box-hover-at-point-mode
(progn (setq-local
eldoc-box-position-function
#'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))
(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)
(kill-local-variable 'eldoc-box-clear-with-C-g)))
(if eldoc-box-hover-mode
(if eldoc-box-hover-at-point-mode
(progn (setq-local
eldoc-box-position-function
#'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))
(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)
(kill-local-variable 'eldoc-box-clear-with-C-g))
(message "Enable eldoc-box-hover-mode first")))
;;;; Backstage
;;;;; Variable