X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=doc%2Fnotmuch-emacs.rst;h=162f62a4c7b2197c2bc28a35c329ed3818cf5571;hb=fe3db23684c9de5b879733b7c7e3f7bbffbee026;hp=fe132327edae33da7457d35655d8e5cb84876c14;hpb=9b4aa9a3e6de1101f3c9443a4b5aabe404d8072e;p=notmuch diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst index fe132327..162f62a4 100644 --- a/doc/notmuch-emacs.rst +++ b/doc/notmuch-emacs.rst @@ -94,6 +94,9 @@ customizing the variables - if you don't want to worry about all of this nonsense, leave this set to `t`. +.. emacsvar:: notmuch-show-empty-saved-searches + + |docstring::notmuch-show-empty-saved-searches| notmuch-hello key bindings -------------------------- @@ -217,8 +220,41 @@ variables. .. emacsvar:: notmuch-search-result-format - Control how each thread of messages is presented in the - ``notmuch-show-mode`` buffer + |docstring::notmuch-search-result-format| + + If the car of an element in notmuch-search-result-format is a + function, insert the result of calling the function into the buffer. + + This allows a user to generate custom fields in the output of a + search result. For example, with the following settings, the first + few characters on each line of the search result are used to show + information about some significant tags associated with the thread. + + .. code:: lisp + + (defun -notmuch-result-flags (format-string result) + (let ((tags-to-letters '(("flagged" . "!") + ("unread" . "u") + ("mine" . "m") + ("sent" . "s") + ("replied" . "r"))) + (tags (plist-get result :tags))) + (format format-string + (mapconcat (lambda (t2l) + (if (member (car t2l) tags) + (cdr t2l) + " ")) + tags-to-letters "")))) + + (setq notmuch-search-result-format '((-notmuch-result-flags . "%s ") + ("date" . "%12s ") + ("count" . "%9s ") + ("authors" . "%-30s ") + ("subject" . "%s ") + ("tags" . "(%s)"))) + + See also :emacsvar:`notmuch-tree-result-format` and + :emacsvar:`notmuch-unthreaded-result-format`. .. emacsvar:: notmuch-search-oldest-first @@ -395,6 +431,31 @@ in :ref:`notmuch-search`. ``c ?`` Show all available copying commands +.. _emacs-show-duplicates: + +Dealing with duplicates +----------------------- + +If there are are multiple files with the same :mailheader:`Message-ID` +(see :any:`duplicate-files`), then :any:`notmuch-show` displays the +number of duplicates and identifies the current duplicate. In the +following example duplicate 3 of 5 is displayed. + +.. code-block:: + :emphasize-lines: 1 + + M. Mustermann (Sat, 30 Jul 2022 10:33:10 -0300) (inbox signed) 3/5 + Subject: Re: Multiple files per message in emacs + To: notmuch@notmuchmail.org + +To display a different message file with the same +:mailheader:`Message-ID`, the user can run the command +:emacscmd:`notmuch-show-choose-duplicate`, by default bound to `%`. + +.. emacscmd:: notmuch-show-choose-duplicate + + |docstring::notmuch-show-choose-duplicate| + .. _notmuch-tree: notmuch-tree @@ -442,6 +503,41 @@ tags. As is the case with :ref:`notmuch-search`, the presentation of results can be controlled by the variable ``notmuch-search-oldest-first``. +.. emacsvar:: notmuch-tree-result-format + + |docstring::notmuch-tree-result-format| + + The following example shows how to optionally display recipients instead + of authors for sent mail (assuming the user is named Mustermann). + + .. code:: lisp + + (defun -notmuch-authors-or-to (format-string result) + (let* ((headers (plist-get result :headers)) + (to (plist-get headers :To)) + (author (plist-get headers :From)) + (face (if (plist-get result :match) + 'notmuch-tree-match-author-face + 'notmuch-tree-no-match-author-face))) + (propertize + (format format-string + (if (string-match "Mustermann" author) + (concat "To:" (notmuch-tree-clean-address to)) + author)) + 'face face))) + + (setq notmuch-tree-result-format + '(("date" . "%12s ") + (-notmuch-authors-or-to . "%-20.20s") + ((("tree" . "%s") + ("subject" . "%s")) + . " %-54s ") + ("tags" . "(%s)"))) + + See also :emacsvar:`notmuch-search-result-format` and + :emacsvar:`notmuch-unthreaded-result-format`. + + .. _notmuch-unthreaded: notmuch-unthreaded @@ -453,6 +549,13 @@ is presented. Keybindings are the same as :any:`notmuch-tree`. +.. emacsvar:: notmuch-unthreaded-result-format + + |docstring::notmuch-unthreaded-result-format| + + See also :emacsvar:`notmuch-search-result-format` and + :emacsvar:`notmuch-tree-result-format`. + Global key bindings ===================