Shoosh compilation warnings

* eldoc-box.el (eldoc-box): New group.
(eldoc-box-hover-mode, eldoc-box--frame): Move up in file.
compilation warning.
This commit is contained in:
João Távora 2018-12-12 14:21:43 +00:00
parent 8232e5eb60
commit ff11ef9392

View File

@ -38,6 +38,10 @@
;;;; Userland ;;;; Userland
;;;;; Variable ;;;;; Variable
(defgroup eldoc-box nil
"Display Eldoc docs in a pretty child frame."
:prefix "eldoc-box-"
:group 'eldoc)
(defface eldoc-box-border '((((background dark)) . (:background "white")) (defface eldoc-box-border '((((background dark)) . (:background "white"))
(((background light)) . (:background "black"))) (((background light)) . (:background "black")))
@ -95,6 +99,9 @@
(eldoc-box--inject-quit-func)) (eldoc-box--inject-quit-func))
(message "No documentation available")))) (message "No documentation available"))))
(defvar eldoc-box--frame nil ;; A backstage variable
"The frame to display doc.")
(defun eldoc-box-quit-frame () (defun eldoc-box-quit-frame ()
"Hide childframe used by eglot doc." "Hide childframe used by eglot doc."
(interactive) (interactive)
@ -104,10 +111,6 @@
;;;; Backstage ;;;; Backstage
;;;;; Variable ;;;;; Variable
(defvar eldoc-box--frame nil
"The frame to display doc.")
(defvar eldoc-box--buffer "*eldoc-box*" (defvar eldoc-box--buffer "*eldoc-box*"
"The buffer used to display eglot doc.") "The buffer used to display eglot doc.")
@ -181,6 +184,17 @@ 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.")
@ -214,18 +228,6 @@ Checkout `lsp-ui-doc--make-frame', `lsp-ui-doc--move-frame'."
(eldoc-box-quit-frame) (eldoc-box-quit-frame)
t)) t))
(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)))
(provide 'eldoc-box) (provide 'eldoc-box)
;;; eldoc-box.el ends here ;;; eldoc-box.el ends here