Add convenient minor mode for at-point mode
This commit is contained in:
parent
bbc1139e95
commit
28eb1d7f8a
17
eldoc-box.el
17
eldoc-box.el
@ -135,6 +135,23 @@ It will be passes with two arguments: WIDTH and HEIGHT of the childframe.")
|
|||||||
(delete-frame eldoc-box--frame)
|
(delete-frame eldoc-box--frame)
|
||||||
(setq eldoc-box--frame nil))))
|
(setq eldoc-box--frame nil))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(define-minor-mode eldoc-box-hover-at-point-mode
|
||||||
|
"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)
|
||||||
|
(add-hook 'pre-command-hook #'eldoc-box-quit-frame t t)
|
||||||
|
(eldoc-box-hover-mode))
|
||||||
|
(eldoc-box-hover-mode -1)
|
||||||
|
(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)))
|
||||||
|
|
||||||
;;;; Backstage
|
;;;; Backstage
|
||||||
;;;;; Variable
|
;;;;; Variable
|
||||||
(defvar eldoc-box--buffer " *eldoc-box*"
|
(defvar eldoc-box--buffer " *eldoc-box*"
|
||||||
|
Loading…
Reference in New Issue
Block a user