[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/notmuch-indicator 2b390022ad 09/36: BREAKING make notmu
From: |
ELPA Syncer |
Subject: |
[elpa] externals/notmuch-indicator 2b390022ad 09/36: BREAKING make notmuch-indicator-args use plists |
Date: |
Wed, 21 Sep 2022 00:59:20 -0400 (EDT) |
branch: externals/notmuch-indicator
commit 2b390022ad876806b2cfd47c1ee16f6566cc90e1
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
BREAKING make notmuch-indicator-args use plists
---
notmuch-indicator.el | 34 +++++++++++++++++++---------------
1 file changed, 19 insertions(+), 15 deletions(-)
diff --git a/notmuch-indicator.el b/notmuch-indicator.el
index 98c02566cb..1f137f1575 100644
--- a/notmuch-indicator.el
+++ b/notmuch-indicator.el
@@ -36,26 +36,30 @@
:group 'notmuch)
(defcustom notmuch-indicator-args
- '(("tag:unread and tag:inbox" "@"))
- "Arguments to format the notmuch mail indicator.
+ '((:terms "tag:unread and tag:inbox" :specifier "@"))
+ "List with plists specifying terms for notmuch count.
-Each list consists of two strings:
+Each plist consists of two properties, both of which accept a
+string value:
-1. The command-line arguments passed to notmuch count.
-2. A string that is prepended to the return value of the above.
+1. The `:terms' holds the command-line arguments passed to
+ notmuch count.
-Multiple lists represent separate notmuch count queries. These
+2. The `:specifier' is an arbitrary string that is prepended to
+ the return value of the above.
+
+Multiple plists represent separate notmuch count queries. These
are run sequentially. Their return values are joined into a
single string.
-For instance, a value like the following specifies two commands:
+For instance, a value like the following defines two commands:
(setq notmuch-indicator-args
- \='((\"tag:unread and tag:inbox\" \"@\")
- (\"--output threads from:VIP\" \"🤡\")))
+ \='((:terms \"tag:unread and tag:inbox\" :specifier \"@\")
+ (:terms \"--output threads from:VIP\" :specifier \"🤡\")))
These form a string like: @50 🤡10."
- :type '(repeat (list string))
+ :type 'list ; TODO 2022-09-19: Use correct type
:group 'notmuch-indicator)
;; TODO 2022-09-19: If this changes, the `notmuch-indicator-mode' needs
@@ -70,14 +74,14 @@ These form a string like: @50 🤡10."
(defun notmuch-indicator--return-count ()
"Parse `notmuch-indicator-args' and format them as single string."
(mapconcat
- (lambda (s)
- (format "%s%s" (or (cadr s) "")
+ (lambda (props)
+ (format "%s%s" (or (plist-get props :specifier) "")
(replace-regexp-in-string
"\n" " "
(shell-command-to-string
- (format "notmuch count %s" (car s))))))
- notmuch-indicator-args
- " "))
+ (format "notmuch count %s" (plist-get props :terms))))))
+ notmuch-indicator-args
+ " "))
(defvar notmuch-indicator--last-state nil
"Internal variable used to store the indicator's state.")
- [elpa] externals/notmuch-indicator 7d56164856 05/36: Add COPYING, (continued)
- [elpa] externals/notmuch-indicator 7d56164856 05/36: Add COPYING, ELPA Syncer, 2022/09/21
- [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 <=
- [elpa] externals/notmuch-indicator d2edfafc38 15/36: Add user option to update indicator post-command, ELPA Syncer, 2022/09/21
- [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