From aa807df9ac3323cc42d5a8ebc45f7be4235962fb Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 9 Nov 2026 10:00:07 +0000 Subject: ednc: wee fixes --- lib/eos/jao-ednc.el | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) (limited to 'lib/eos') 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 ;; 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 -- cgit v1.2.3