From: Jonas Bernoulli <jonas@bernoul.li>
To: notmuch@notmuchmail.org
Subject: [PATCH 3/5] emacs: fix some option type declarations
Date: Mon, 19 Jul 2021 13:31:07 +0200 [thread overview]
Message-ID: <20210719113109.5197-4-jonas@bernoul.li> (raw)
In-Reply-To: <20210719113109.5197-1-jonas@bernoul.li>
Also improve their doc-strings.
---
emacs/notmuch-tree.el | 66 +++++++++++++++++++++++++------------------
emacs/notmuch.el | 13 +++++----
2 files changed, 47 insertions(+), 32 deletions(-)
diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index b288c05d..d11ef38c 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -77,21 +77,28 @@ (defun notmuch-tree-show-out ()
(defcustom notmuch-tree-result-format
`(("date" . "%12s ")
("authors" . "%-20s")
- ((("tree" . "%s")("subject" . "%s")) ." %-54s ")
+ ((("tree" . "%s")
+ ("subject" . "%s"))
+ . " %-54s ")
("tags" . "(%s)"))
- "Result formatting for tree view. Supported fields are: date,
-authors, subject, tree, tags. Tree means the thread tree
-box graphics. The field may also be a list in which case
-the formatting rules are applied recursively and then the
-output of all the fields in the list is inserted
-according to format-string.
-
-Note the author string should not contain
-whitespace (put it in the neighbouring fields instead).
-For example:
- (setq notmuch-tree-result-format \(\(\"authors\" . \"%-40s\"\)
- \(\"subject\" . \"%s\"\)\)\)"
- :type '(alist :key-type (string) :value-type (string))
+ "Result formatting for tree view.
+
+Supported fields are: date, authors, subject, tree, tags.
+
+Tree means the thread tree box graphics. The field may
+also be a list in which case the formatting rules are
+applied recursively and then the output of all the fields
+in the list is inserted according to format-string.
+
+Note that the author string should not contain whitespace
+\(put it in the neighbouring fields instead). For example:
+ (setq notmuch-tree-result-format
+ '((\"authors\" . \"%-40s\")
+ (\"subject\" . \"%s\")))"
+ :type '(alist :key-type (choice string
+ (alist :key-type string
+ :value-type string))
+ :value-type string)
:group 'notmuch-tree)
(defcustom notmuch-unthreaded-result-format
@@ -99,19 +106,24 @@ (defcustom notmuch-unthreaded-result-format
("authors" . "%-20s")
((("subject" . "%s")) ." %-54s ")
("tags" . "(%s)"))
- "Result formatting for unthreaded tree view. Supported fields are: date,
-authors, subject, tree, tags. Tree means the thread tree
-box graphics. The field may also be a list in which case
-the formatting rules are applied recursively and then the
-output of all the fields in the list is inserted
-according to format-string.
-
-Note the author string should not contain
-whitespace (put it in the neighbouring fields instead).
-For example:
- (setq notmuch-tree-result-format \(\(\"authors\" . \"%-40s\"\)
- \(\"subject\" . \"%s\"\)\)\)"
- :type '(alist :key-type (string) :value-type (string))
+ "Result formatting for unthreaded tree view.
+
+Supported fields are: date, authors, subject, tree, tags.
+
+Tree means the thread tree box graphics. The field may
+also be a list in which case the formatting rules are
+applied recursively and then the output of all the fields
+in the list is inserted according to format-string.
+
+Note that the author string should not contain whitespace
+\(put it in the neighbouring fields instead). For example:
+ (setq notmuch-unthreaded-result-format
+ '((\"authors\" . \"%-40s\")
+ (\"subject\" . \"%s\")))"
+ :type '(alist :key-type (choice string
+ (alist :key-type string
+ :value-type string))
+ :value-type string)
:group 'notmuch-tree)
(defun notmuch-tree-result-format ()
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 351334aa..7f10c509 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -88,18 +88,21 @@ (defcustom notmuch-search-result-format
("authors" . "%-20s ")
("subject" . "%s ")
("tags" . "(%s)"))
- "Search result formatting. Supported fields are:
- date, count, authors, subject, tags
+ "Search result formatting.
+
+Supported fields are: date, count, authors, subject, tags.
For example:
- (setq notmuch-search-result-format \(\(\"authors\" . \"%-40s\"\)
- \(\"subject\" . \"%s\"\)\)\)
+ (setq notmuch-search-result-format
+ '((\"authors\" . \"%-40s\")
+ (\"subject\" . \"%s\")))
+
Line breaks are permitted in format strings (though this is
currently experimental). Note that a line break at the end of an
\"authors\" field will get elided if the authors list is long;
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 string :value-type string)
:group 'notmuch-search)
;; The name of this variable `notmuch-init-file' is consistent with the
--
2.31.1
next prev parent reply other threads:[~2021-07-19 11:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-19 11:31 [PATCH 0/5] Use closures and other emacs cleanup Jonas Bernoulli
2021-07-19 11:31 ` [PATCH 1/5] emacs: use closures instead of backquoted lambdas Jonas Bernoulli
2021-07-19 11:31 ` [PATCH 2/5] emacs: add some function declarations Jonas Bernoulli
2021-07-19 11:31 ` Jonas Bernoulli [this message]
2021-07-19 11:31 ` [PATCH 4/5] emacs: notmuch-show-pipe-message: cosmetics Jonas Bernoulli
2021-07-19 11:31 ` [PATCH 5/5] emacs: shorten lines in two doc-strings Jonas Bernoulli
2021-07-23 20:18 ` [PATCH 0/5] Use closures and other emacs cleanup Tomi Ollila
2021-08-30 1:04 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210719113109.5197-4-jonas@bernoul.li \
--to=jonas@bernoul.li \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).