summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-04-12 20:16:28 +0100
committerjao <jao@gnu.org>2024-04-12 20:16:28 +0100
commitf82eb0bc8504ad39184e711849e7bd951b50cf77 (patch)
tree532abf2b0ec1068377bc31a2e2065479a54ba26c
parent9e551f916cf0f357b43e6be79f55a7173a0ffe2c (diff)
downloadelibs-f82eb0bc8504ad39184e711849e7bd951b50cf77.tar.gz
elibs-f82eb0bc8504ad39184e711849e7bd951b50cf77.tar.bz2
ednc nits
-rw-r--r--init.el2
-rw-r--r--lib/eos/jao-ednc.el20
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)