Make compiler happy and add autoload

This commit is contained in:
Yuan Fu 2018-12-16 03:57:56 -05:00
parent 4af83a852c
commit d722255ebc
No known key found for this signature in database
GPG Key ID: 1CF5ECABEC37A901

View File

@ -101,6 +101,18 @@ Consider your machine's screen's resolution when setting this variable.")
(when eldoc-box--frame (when eldoc-box--frame
(make-frame-invisible eldoc-box--frame t))) (make-frame-invisible eldoc-box--frame t)))
;;;###autoload
(define-minor-mode eldoc-box-hover-mode
"Displays hover documentations in a childframe. This mode is buffer local."
:lighter " ELDOC-BOX"
(if eldoc-box-hover-mode
(add-function :before-until (local 'eldoc-message-function)
#'eldoc-box--eldoc-message-function)
(remove-function (local 'eldoc-message-function) #'eldoc-box--eldoc-message-function)
;; if minor mode is turned off when childframe is visible
;; hide it
(eldoc-box-quit-frame)))
;;;; Backstage ;;;; Backstage
;;;;; Variable ;;;;; Variable
(defvar eldoc-box--buffer " *eldoc-box*" (defvar eldoc-box--buffer " *eldoc-box*"
@ -179,16 +191,6 @@ Checkout `lsp-ui-doc--make-frame', `lsp-ui-doc--move-frame'."
(setq eldoc-box--frame frame))) (setq eldoc-box--frame frame)))
;;;;; ElDoc ;;;;; ElDoc
(define-minor-mode eldoc-box-hover-mode
"Displays hover documentations in a childframe. This mode is buffer local."
:lighter " ELDOC-BOX"
(if eldoc-box-hover-mode
(add-function :before-until (local 'eldoc-message-function)
#'eldoc-box--eldoc-message-function)
(remove-function (local 'eldoc-message-function) #'eldoc-box--eldoc-message-function)
;; if minor mode is turned off when childframe is visible
;; hide it
(eldoc-box-quit-frame)))
(defvar eldoc-box--cleanup-timer nil (defvar eldoc-box--cleanup-timer nil
"The timer used to cleanup childframe after ElDoc.") "The timer used to cleanup childframe after ElDoc.")