Document all functions

This commit is contained in:
MitchMarq42 2023-08-06 18:29:26 -08:00
parent 1c86a8d429
commit 177e878e15

View File

@ -94,6 +94,7 @@
nil) nil)
(defun notibox-alert (info) (defun notibox-alert (info)
"Show a notibox corresponding with INFO. Can* be used as a backend for `alert'."
(let* ((message (plist-get info :message)) (let* ((message (plist-get info :message))
(title (plist-get info :title)) (title (plist-get info :title))
(timeout (plist-get info :persistent))) (timeout (plist-get info :persistent)))
@ -101,6 +102,7 @@
(notibox--show (unless timeout alert-fade-time)))) (notibox--show (unless timeout alert-fade-time))))
(defun notibox--hide (frame) (defun notibox--hide (frame)
"Stop showing FRAME."
(posframe-hide "*notibox*")) (posframe-hide "*notibox*"))
(defun notibox-delete (frame) (defun notibox-delete (frame)
@ -109,6 +111,7 @@
(pop notibox-current-posframes)) (pop notibox-current-posframes))
(defun notibox--tail-echoarea () (defun notibox--tail-echoarea ()
"Show `current-message' in the notibox. If that does not exist, probably hide it."
(if (current-message) (if (current-message)
(notibox-alert `( (notibox-alert `(
:title ,(format "%s" (current-buffer)) :title ,(format "%s" (current-buffer))
@ -117,11 +120,13 @@
(notibox-delete 'current)))) (notibox-delete 'current))))
(defun notibox/setup-timer () (defun notibox/setup-timer ()
"Start running notibox."
(interactive) (interactive)
(run-with-timer notibox--refresh-delay notibox--refresh-delay #'notibox--tail-echoarea)) (run-with-timer notibox--refresh-delay notibox--refresh-delay #'notibox--tail-echoarea))
;; (notibox--hide 'anything) ;; (notibox--hide 'anything)
(defun notibox-test-alert () (defun notibox-test-alert ()
"Show a sample notibox to prove we can."
(interactive) (interactive)
(notibox-alert '(:title "five" :message "six"))) (notibox-alert '(:title "five" :message "six")))