[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/notmuch-indicator d2edfafc38 15/36: Add user option to
From: |
ELPA Syncer |
Subject: |
[elpa] externals/notmuch-indicator d2edfafc38 15/36: Add user option to update indicator post-command |
Date: |
Wed, 21 Sep 2022 00:59:20 -0400 (EDT) |
branch: externals/notmuch-indicator
commit d2edfafc381c1c03f64fbcaade406d34b4ea7365
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add user option to update indicator post-command
---
notmuch-indicator.el | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/notmuch-indicator.el b/notmuch-indicator.el
index 45bf5d8f00..a081ab6e7e 100644
--- a/notmuch-indicator.el
+++ b/notmuch-indicator.el
@@ -70,10 +70,20 @@ These form a string like: @50 🤡10."
;; with `setq'.
(defcustom notmuch-indicator-refresh-count (* 60 3)
"How often to update the indicator, in seconds.
-It probably is better to not set this to a very low number."
+It probably is better to not set this to a very low number.
+
+Also see `notmuch-indicator-force-refresh-commands'."
:type 'number
:group 'notmuch-indicator)
+(defcustom notmuch-indicator-force-refresh-commands
+ '(notmuch-refresh-this-buffer)
+ "List of commands that update the notmuch-indicator after invoked.
+Normally, the indicator runs on a timer, controlled by the user
+option `notmuch-indicator-refresh-count'."
+ :type '(repeat symbol)
+ :group 'notmuch-indicator)
+
;;;; Helper functions and the minor-mode
(defun notmuch-indicator--return-count ()
@@ -119,6 +129,12 @@ The delay is specified by
`notmuch-indicator-refresh-count'."
(notmuch-indicator--indicator)
(run-at-time t notmuch-indicator-refresh-count
#'notmuch-indicator--indicator)))
+(defun notmuch-indicator--refresh ()
+ "Refresh the active indicator."
+ (when (notmuch-indicator--running-p)
+ (cancel-function-timers #'notmuch-indicator--indicator)
+ (notmuch-indicator--run)))
+
;;;###autoload
(define-minor-mode notmuch-indicator-mode
"Display counter with output from notmuch count.
@@ -130,9 +146,14 @@ option `notmuch-indicator-refresh-count'.."
:init-value nil
:global t
(if notmuch-indicator-mode
- (notmuch-indicator--run)
+ (progn
+ (notmuch-indicator--run)
+ (dolist (fn notmuch-indicator-force-refresh-commands)
+ (advice-add fn :after #'notmuch-indicator--refresh)))
(cancel-function-timers #'notmuch-indicator--indicator)
(setq global-mode-string (delete notmuch-indicator--last-state
global-mode-string))
+ (dolist (fn notmuch-indicator-force-refresh-commands)
+ (advice-remove fn #'notmuch-indicator--refresh))
(force-mode-line-update t)))
(provide 'notmuch-indicator)
- [elpa] externals/notmuch-indicator 83e1bd3ceb 07/36: Tweak code to avoid multiple timers, (continued)
- [elpa] externals/notmuch-indicator 83e1bd3ceb 07/36: Tweak code to avoid multiple timers, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator b141304bcb 04/36: Add README, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator d24ae8718a 14/36: Add outline headings, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator f716f06aea 11/36: Use ":label" instead of ":specifier", ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator e169f26958 19/36: Add notmuch-indicator-hide-empty-counters user option, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator b225981c47 20/36: Refine how spacing is done, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 45120219c4 23/36: Tweak spacing in two defcustom, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 55a759133d 02/36: Tweak notmuch-indicator-args, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 9a536bf3be 08/36: Add :group to notmuch-indicator-refresh-count, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 2b390022ad 09/36: BREAKING make notmuch-indicator-args use plists, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator d2edfafc38 15/36: Add user option to update indicator post-command,
ELPA Syncer <=
- [elpa] externals/notmuch-indicator f043b8a1e8 22/36: Abstract notmuch-indicator--format-output, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator c9b7b8c229 26/36: The package is no longer a work-in-progress, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 62ca2dd0bb 31/36: Refine notmuch-indicator-force-refresh-commands :type, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 6f881fe3c2 32/36: Tweak THE most important part of the package, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 251323c938 12/36: Update notmuch-indicator-refresh-count doc string, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator c97a631740 13/36: Update notmuch-indicator-mode doc string, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 598dedf992 18/36: Add docs to the Commentary, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator c06c876e74 21/36: Improve one-line description, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator bfb48f7773 28/36: Accept :face in notmuch-indicator-args, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 58633d173a 33/36: Add mailing list to package headers, ELPA Syncer, 2022/09/21