summaryrefslogtreecommitdiffhomepage
path: root/lib/eos
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2026-11-09 10:00:07 +0000
committerjao <jao@gnu.org>2026-11-09 10:00:07 +0000
commitaa807df9ac3323cc42d5a8ebc45f7be4235962fb (patch)
treeafdd3d26f6f582642790a04ec93db931193a16d1 /lib/eos
parent255eca68a56e367d849ca598af391b0929d176cb (diff)
downloadelibs-aa807df9ac3323cc42d5a8ebc45f7be4235962fb.tar.gz
elibs-aa807df9ac3323cc42d5a8ebc45f7be4235962fb.tar.bz2
ednc: wee fixes
Diffstat (limited to 'lib/eos')
-rw-r--r--lib/eos/jao-ednc.el39
1 files changed, 24 insertions, 15 deletions
diff --git a/lib/eos/jao-ednc.el b/lib/eos/jao-ednc.el
index 92ee21f..a12b3eb 100644
--- a/lib/eos/jao-ednc.el
+++ b/lib/eos/jao-ednc.el
@@ -1,6 +1,6 @@
;;; jao-ednc.el --- Minibuffer notifications using EDNC -*- lexical-binding: t; -*-
-;; Copyright (C) 2020, 2021, 2024 jao
+;; Copyright (C) 2020, 2021, 2024, 2026 jao
;; Author: jao <mail@jao.io>
;; Keywords: tools, abbrev
@@ -25,11 +25,17 @@
;;; Code:
-(require 'ednc)
(require 'jao-minibuffer)
(declare-function tracking-add-buffer "tracking")
(declare-function tracking-remove-buffer "tracking")
+(declare-function ednc-invoke-action "ednc")
+(declare-function ednc-mode "ednc")
+(declare-function ednc-notification-app-name "ednc")
+(declare-function ednc-dismiss-notification "ednc")
+(declare-function ednc-format-notification "ednc")
+
+(defvar ednc-log-name)
(defvar jao-ednc--count-format " {%d} ")
(defvar jao-ednc--notifications ())
@@ -65,7 +71,8 @@
(defun jao-ednc--clean (&optional notification)
(tracking-remove-buffer (get-buffer ednc-log-name))
(if notification
- (remove notification jao-ednc--notifications)
+ (setq jao-ednc--notifications
+ (delete notification jao-ednc--notifications))
(pop jao-ednc--notifications))
(jao-minibuffer-refresh))
@@ -91,18 +98,6 @@
(when old (funcall (jao-ednc--handler old) old nil))
(when new (funcall (jao-ednc--handler new) new t)))
-(defun jao-ednc-setup (minibuffer-order)
- (setq jao-notify-use-messages t)
- (with-eval-after-load "tracking"
- (when jao-ednc-use-tracking
- (add-to-list 'tracking-faces-priorities 'jao-ednc-tracking)
- (when (listp tracking-shorten-modes)
- (add-to-list 'tracking-shorten-modes 'ednc-view-mode))))
- (when minibuffer-order
- (jao-minibuffer-add-variable '(jao-ednc--count) minibuffer-order))
- (add-hook 'ednc-notification-presentation-functions #'jao-ednc--on-notify)
- (ednc-mode))
-
(defun jao-ednc-pop ()
(interactive)
(pop-to-buffer-same-window ednc-log-name))
@@ -139,5 +134,19 @@
(while (jao-ednc--last-notification)
(jao-ednc-dismiss)))
+;;;###autoload
+(defun jao-ednc-setup (minibuffer-order)
+ (require 'ednc)
+ (setq jao-notify-use-messages t)
+ (with-eval-after-load "tracking"
+ (when jao-ednc-use-tracking
+ (add-to-list 'tracking-faces-priorities 'jao-ednc-tracking)
+ (when (listp tracking-shorten-modes)
+ (add-to-list 'tracking-shorten-modes 'ednc-view-mode))))
+ (when minibuffer-order
+ (jao-minibuffer-add-variable '(jao-ednc--count) minibuffer-order))
+ (add-hook 'ednc-notification-presentation-functions #'jao-ednc--on-notify)
+ (ednc-mode))
+
(provide 'jao-ednc)
;;; jao-ednc.el ends here