[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/notmuch-indicator bfb48f7773 28/36: Accept :face in not
From: |
ELPA Syncer |
Subject: |
[elpa] externals/notmuch-indicator bfb48f7773 28/36: Accept :face in notmuch-indicator-args |
Date: |
Wed, 21 Sep 2022 00:59:21 -0400 (EDT) |
branch: externals/notmuch-indicator
commit bfb48f7773d097a93dd083d733fdf2e850a31999
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Accept :face in notmuch-indicator-args
---
notmuch-indicator.el | 44 +++++++++++++++++++++++++++++---------------
1 file changed, 29 insertions(+), 15 deletions(-)
diff --git a/notmuch-indicator.el b/notmuch-indicator.el
index 4254a59b15..ef798ec795 100644
--- a/notmuch-indicator.el
+++ b/notmuch-indicator.el
@@ -84,21 +84,30 @@
(defcustom notmuch-indicator-args '((:terms "tag:unread and tag:inbox" :label
"@"))
"List of plists specifying terms for `notmuch-count(1)'.
-Each plist consists of two properties, both of which accept a
-string value:
+Each plist consists of one mandarory property and two optional
+ones:
-1. The `:terms' holds the command-line arguments passed to
- `notmuch-count(1)' (read the Notmuch documentation for the
- technicalities).
+1. The `:terms', which is required, is a string that holds the
+ command-line arguments passed to `notmuch-count(1)' (read the
+ Notmuch documentation for the technicalities).
-2. The `:label' is an arbitrary string that is prepended to
- the return value of the above.
+2. The `:label', which is optional, is an arbitrary string that
+ is prepended to the return value of the above. If nil or
+ omitted, no label is displayed.
-Multiple plists represent separate `notmuch-count(1)' queries.
-These are run sequentially. Their return values are joined into
-a single string.
+3. The `face', which is optional, is the symbol of a face that is
+ applied to the `:label'. It should not be quoted, so like
+ :face bold. Good candidates are `bold', `italic', `success',
+ `warning', `error', though anything will do. If nil or
+ omitted, no face is used.
-For instance, a value like the following defines two commands:
+Multiple plist lists represent separate `notmuch-count(1)'
+queries. These are run sequentially. Their return values are
+joined into a single string.
+
+For instance, a value like the following defines two commands (in
+the source code the quotes are escaped---please check the Help
+buffer for the clean code (I dislike markup in doc strings)):
(setq notmuch-indicator-args
\='((:terms \"tag:unread and tag:inbox\" :label \"@\")
@@ -141,9 +150,11 @@ option `notmuch-indicator-refresh-count'."
(shell-command-to-string
(format "notmuch count %s" terms))))
-(defun notmuch-indicator--format-label (label count)
- "Format LABEL and COUNT of `notmuch-indicator-args'."
- (format "%s%s " (or label "") count))
+(defun notmuch-indicator--format-label (label count face)
+ "Format LABEL, COUNT, FACE of `notmuch-indicator-args'."
+ (if (and face label)
+ (format "%s%s " (propertize label 'face face) count)
+ (format "%s%s " (or label "") count)))
(defun notmuch-indicator--format-output (properties)
"Format PROPERTIES of `notmuch-indicator-args'."
@@ -151,7 +162,10 @@ option `notmuch-indicator-refresh-count'."
(if (and (zerop (string-to-number count))
notmuch-indicator-hide-empty-counters)
""
- (notmuch-indicator--format-label (plist-get properties :label) count))))
+ (notmuch-indicator--format-label
+ (plist-get properties :label)
+ count
+ (plist-get properties :face)))))
(defun notmuch-indicator--return-count ()
"Parse `notmuch-indicator-args' and format them as single string."
- [elpa] externals/notmuch-indicator 2b390022ad 09/36: BREAKING make notmuch-indicator-args use plists, (continued)
- [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, 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 <=
- [elpa] externals/notmuch-indicator 58633d173a 33/36: Add mailing list to package headers, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 9611974047 35/36: Add backronym in the Commentary, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 700772763b 17/36: Add documentation to the README, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator c086659fcc 24/36: Add gitignore file, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator f924375d5f 25/36: Add dir-locals file, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 5db7d40f33 27/36: Reword a statement, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator c7e62b16a0 29/36: Update docs in light of commit bfb48f7, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator 30edbd3a9e 30/36: Use correct type for notmuch-indicator-args, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator f96b93ab52 34/36: Add package sources, ELPA Syncer, 2022/09/21
- [elpa] externals/notmuch-indicator f4b46313c3 36/36: Update to version 0.1.0, ELPA Syncer, 2022/09/21