diff options
-rw-r--r-- | misc/jao-minibuffer.el | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/misc/jao-minibuffer.el b/misc/jao-minibuffer.el index 132566a..7104544 100644 --- a/misc/jao-minibuffer.el +++ b/misc/jao-minibuffer.el @@ -29,6 +29,7 @@ (defvar jao-minibuffer-align-right-p t) (defvar jao-minibuffer-right-margin (if window-system 0 1)) (defvar jao-minibuffer-maximized-frames-p t) +(defvar jao-minibuffer-notification-timeout 5) (defconst jao-minibuffer--name " *Minibuf-0*") @@ -72,9 +73,21 @@ (defun jao-minibuffer-add-variable (variable-name &optional append) (add-to-list 'jao-minibuffer-info `(:eval ,variable-name) append)) +(defvar jao-minibuffer--notification-timer nil) + +(defun jao-minibuffer--start-notification-timer (timeout) + (interactive) + (when jao-minibuffer--notification-timer + (cancel-timer jao-minibuffer--notification-timer)) + (setq jao-minibuffer--notification-timer + (run-with-idle-timer (or timeout jao-minibuffer-notification-timeout) + nil + 'jao-minibuffer-pop-notification))) + ;;;###autoload -(defun jao-minibuffer-push-notification (msg) +(defun jao-minibuffer-push-notification (msg &optional timeout) (setq jao-minibuffer-notification msg) + (jao-minibuffer--start-notification-timer timeout) (jao-minibuffer-refresh)) ;;;###autoload |