From f82eb0bc8504ad39184e711849e7bd951b50cf77 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 12 Apr 2024 20:16:28 +0100 Subject: ednc nits --- init.el | 2 +- lib/eos/jao-ednc.el | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/init.el b/init.el index dd4adab..e2a921d 100644 --- a/init.el +++ b/init.el @@ -583,8 +583,8 @@ ["Notifications" ("s" "show last" jao-ednc-show) ("S" "show all" jao-ednc-pop) + ("n" "dismiss and show" jao-ednc-dismiss-and-show :transient t) ("d" "dismiss last" jao-ednc-dismiss) - ("n" "dismiss and show" jao-ednc-dismiss :transient t) ("D" "dismiss all" jao-ednc-dismiss-all) ("i" "invoke last action" jao-ednc-invoke-last-action)]) (global-set-key (kbd "s-n") #'jao-transient-ednc)) diff --git a/lib/eos/jao-ednc.el b/lib/eos/jao-ednc.el index ccd098e..92ee21f 100644 --- a/lib/eos/jao-ednc.el +++ b/lib/eos/jao-ednc.el @@ -91,7 +91,6 @@ (when old (funcall (jao-ednc--handler old) old nil)) (when new (funcall (jao-ednc--handler new) new t))) -;;;###autoload (defun jao-ednc-setup (minibuffer-order) (setq jao-notify-use-messages t) (with-eval-after-load "tracking" @@ -104,19 +103,16 @@ (add-hook 'ednc-notification-presentation-functions #'jao-ednc--on-notify) (ednc-mode)) -;;;###autoload (defun jao-ednc-pop () (interactive) (pop-to-buffer-same-window ednc-log-name)) -;;;###autoload (defun jao-ednc-show () (interactive) (if (not (jao-ednc--last-notification)) (jao-ednc-pop) (jao-ednc--show-last))) -;;;###autoload (defun jao-ednc-invoke-last-action () (interactive) (if (jao-ednc--last-notification) @@ -124,18 +120,20 @@ (message "No active notifications")) (jao-ednc--clean)) -;;;###autoload (defun jao-ednc-dismiss () + (interactive) + (when (jao-ednc--last-notification) + (ignore-errors + (with-current-buffer ednc-log-name + (ednc-dismiss-notification (jao-ednc--last-notification))))) + (jao-ednc--clean)) + +(defun jao-ednc-dismiss-and-show () (interactive) (let ((m (jao-ednc--format-last))) - (when (jao-ednc--last-notification) - (ignore-errors - (with-current-buffer ednc-log-name - (ednc-dismiss-notification (jao-ednc--last-notification))))) - (jao-ednc--clean) + (jao-ednc-dismiss) (when m (message m)))) -;;;###autoload (defun jao-ednc-dismiss-all () (interactive) (while (jao-ednc--last-notification) -- cgit v1.2.3