aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2022-07-16 17:22:23 -0400
committerDavid Bremner <david@tethera.net>2022-07-30 08:52:26 -0300
commit4237409fafb429b6411049981699041e7627d720 (patch)
treefad66b76c6543c8d94cb9b77a89f2ab7b26e7d44
parent1ef7c75111b84ea19af3186ddc12f2ba434c93de (diff)
emacs: update defcustom for notmuch-search-result-format.
It seems redundant to have the previous example, since the default value is always show by describe variable. Enforce more restrictions on the keys in the alist, since arbitrary strings don't work as field names. Document that functions can be used in lieu of field names.
-rw-r--r--emacs/notmuch.el21
1 files changed, 15 insertions, 6 deletions
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 01a92997..5cb7acd2 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -90,11 +90,11 @@
("tags" . "(%s)"))
"Search result formatting.
-Supported fields are: date, count, authors, subject, tags.
-For example:
- (setq notmuch-search-result-format
- \\='((\"authors\" . \"%-40s\")
- (\"subject\" . \"%s\")))
+List of pairs of (field . format-string). Supported field
+strings are: \"date\", \"count\", \"authors\", \"subject\",
+\"tags\". It is also supported to pass a function in place of a
+field name. In this case the function is passed the thread
+object (plist) and format string.
Line breaks are permitted in format strings (though this is
currently experimental). Note that a line break at the end of an
@@ -102,7 +102,16 @@ currently experimental). Note that a line break at the end of an
place it instead at the beginning of the following field. To
enter a line break when setting this variable with setq, use \\n.
To enter a line break in customize, press \\[quoted-insert] C-j."
- :type '(alist :key-type string :value-type string)
+ :type '(alist
+ :key-type
+ (choice
+ (const :tag "Date" "date")
+ (const :tag "Count" "count")
+ (const :tag "Authors" "authors")
+ (const :tag "Subject" "subject")
+ (const :tag "Tags" "tags")
+ function)
+ :value-type (string :tag "Format"))
:group 'notmuch-search)
;; The name of this variable `notmuch-init-file' is consistent with the