update of packages

This commit is contained in:
2023-11-04 19:26:41 +01:00
parent e162a12b58
commit 3b54a3236d
726 changed files with 297673 additions and 34585 deletions

View File

@@ -153,8 +153,7 @@ matching `notmuch-address-completion-headers-regexp'."
;;; Setup
(defun notmuch-address-selection-function (prompt collection initial-input)
"Call (`completing-read'
PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)"
"Default address selection function: delegate to completing read."
(completing-read
prompt collection nil nil initial-input 'notmuch-address-history))

View File

@@ -145,7 +145,7 @@ a plist. Supported properties are
or nil. Nil means use the default sort order.
:search-type Specify whether to run the search in search-mode,
tree mode or unthreaded mode. Set to `tree' to
specify tree mode, 'unthreaded to specify
specify tree mode, \\='unthreaded to specify
unthreaded mode, and set to nil (or anything
except tree and unthreaded) to specify search
mode.
@@ -717,7 +717,8 @@ with `notmuch-hello-query-counts'."
"Keymap for \"notmuch hello\" buffers.")
(define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
"Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
"Major mode for convenient notmuch navigation. This is your entry
portal into notmuch.
Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
or click on a saved search to view matching threads. Edit saved
@@ -853,7 +854,8 @@ Complete list of currently available key bindings:
(widget-create 'notmuch-search-item :value search :size width)))))
(defun notmuch-hello-insert-searches (title query-list &rest options)
"Insert a section with TITLE showing a list of buttons made from QUERY-LIST.
"Insert a section with TITLE showing a list of buttons made from
QUERY-LIST.
QUERY-LIST should ideally be a plist but for backwards
compatibility other forms are also accepted (see
@@ -867,13 +869,16 @@ Supports the following entries in OPTIONS as a plist:
:show-empty-searches - show buttons with no matching messages
:hide-if-empty - hide if no buttons would be shown
(only makes sense without :show-empty-searches)
:filter - This can be a function that takes the search query as its argument and
returns a filter to be used in conjunction with the query for that search or nil
to hide the element. This can also be a string that is used as a combined with
each query using \"and\".
:filter-count - Separate filter to generate the count displayed each search. Accepts
the same values as :filter. If :filter and :filter-count are specified, this
will be used instead of :filter, not in conjunction with it."
:filter - This can be a function that takes the search query as
its argument and returns a filter to be used in conjunction
with the query for that search or nil to hide the
element. This can also be a string that is used as a combined
with each query using \"and\".
:filter-count - Separate filter to generate the count displayed
each search. Accepts the same values as :filter. If :filter
and :filter-count are specified, this will be used instead of
:filter, not in conjunction with it."
(widget-insert title ": ")
(when (and notmuch-hello-first-run (plist-get options :initially-hidden))
(add-to-list 'notmuch-hello-hidden-sections title))

View File

@@ -414,9 +414,9 @@ This is similar to `describe-function' for the current major
mode, but bindings tables are shown with documentation strings
rather than command names. By default, this uses the first line
of each command's documentation string. A command can override
this by setting the 'notmuch-doc property of its command symbol.
this by setting the \\='notmuch-doc property of its command symbol.
A command that supports a prefix argument can explicitly document
its prefixed behavior by setting the 'notmuch-prefix-doc property
its prefixed behavior by setting the \\='notmuch-prefix-doc property
of its command symbol."
(interactive)
(let ((doc (substitute-command-keys
@@ -703,6 +703,7 @@ current buffer, if possible."
(when (mm-inlinable-p handle)
(set-buffer display-buffer)
(mm-display-part handle)
(plist-put part :undisplayer (mm-handle-undisplayer handle))
t))))))
;;; Generic Utilities
@@ -725,7 +726,7 @@ single element face list."
(list face)))
(defun notmuch-apply-face (object face &optional below start end)
"Combine FACE into the 'face text property of OBJECT between START and END.
"Combine FACE into the \\='face text property of OBJECT between START and END.
This function combines FACE with any existing faces between START
and END in OBJECT. Attributes specified by FACE take precedence

View File

@@ -403,7 +403,7 @@ instead of `message-mode' and SWITCH-FUNCTION is mandatory."
(defun notmuch-mua-mail (&optional to subject other-headers _continue
switch-function yank-action send-actions
return-action &rest ignored)
return-action &rest _ignored)
"Invoke the notmuch mail composition window.
The position of point when the function returns differs depending

View File

@@ -35,7 +35,7 @@ complete S-expression from the input. However, it extends this
with an additional function that requires the next value in the
input to be a list and descends into it, allowing its elements to
be read one at a time or further descended into. Both functions
can return 'retry to indicate that not enough input is available.
can return \\='retry to indicate that not enough input is available.
The parser always consumes input from point in the current
buffer. Hence, the caller is allowed to delete any data before
@@ -52,10 +52,10 @@ point and may resynchronize after an error by moving point."
(defun notmuch-sexp-read (sp)
"Consume and return the value at point in the current buffer.
Returns 'retry if there is insufficient input to parse a complete
Returns \\='retry if there is insufficient input to parse a complete
value (though it may still move point over whitespace). If the
parser is currently inside a list and the next token ends the
list, this moves point just past the terminator and returns 'end.
list, this moves point just past the terminator and returns \\='end.
Otherwise, this moves point to just past the end of the value and
returns the value."
(skip-chars-forward " \n\r\t")
@@ -125,7 +125,7 @@ returns the value."
(defun notmuch-sexp-begin-list (sp)
"Parse the beginning of a list value and enter the list.
Returns 'retry if there is insufficient input to parse the
Returns \\='retry if there is insufficient input to parse the
beginning of the list. If this is able to parse the beginning of
a list, it moves point past the token that opens the list and
returns t. Later calls to `notmuch-sexp-read' will return the

View File

@@ -1,4 +1,4 @@
(define-package "notmuch" "20221115.1134" "run notmuch within emacs" 'nil :commit "5ba7684445b9338ab289d502d4688d9aff3d8803" :url "https://notmuchmail.org")
(define-package "notmuch" "20231006.2337" "run notmuch within emacs" 'nil :commit "e4ead7656c72092bf30c43283057c2d4c4107962" :url "https://notmuchmail.org")
;; Local Variables:
;; no-byte-compile: t
;; End:

View File

@@ -41,11 +41,11 @@
;;; Utility functions
(defun notmuch-print-run-evince (file)
"View FILE using 'evince'."
"View FILE using `evince'."
(start-process "evince" nil "evince" file))
(defun notmuch-print-run-muttprint (&optional output)
"Pass the contents of the current buffer to 'muttprint'.
"Pass the contents of the current buffer to `muttprint'.
Optional OUTPUT allows passing a list of flags to muttprint."
(apply #'notmuch--call-process-region (point-min) (point-max)

View File

@@ -644,8 +644,24 @@ message at DEPTH in the current thread."
(when show
(button-put button :notmuch-lazy-part nil)
(notmuch-show-lazy-part lazy-part button))
;; else there must be an overlay.
(overlay-put overlay 'invisible (not show))
(let* ((part (plist-get properties :notmuch-part))
(undisplayer (plist-get part :undisplayer))
(mime-type (plist-get part :computed-type))
(redisplay-data (button-get button
:notmuch-redisplay-data))
(imagep (string-match "^image/" mime-type)))
(cond
((and imagep (not show) undisplayer)
;; call undisplayer thunk created by gnus.
(funcall undisplayer)
;; there is an extra newline left
(delete-region
(+ 1 (button-end button))
(+ 2 (button-end button))))
((and imagep show redisplay-data)
(notmuch-show-lazy-part redisplay-data button))
(t
(overlay-put overlay 'invisible (not show)))))
t)))))))
;;; Part content ID handling
@@ -1019,10 +1035,13 @@ will return nil if the CID is unknown or cannot be retrieved."
(part-end (copy-marker (point) t))
;; We have to save the depth as we can't find the depth
;; when narrowed.
(depth (notmuch-show-get-depth)))
(depth (notmuch-show-get-depth))
(mime-type (plist-get (cadr part-args) :computed-type)))
(save-restriction
(narrow-to-region part-beg part-end)
(delete-region part-beg part-end)
(when (and mime-type (string-match "^image/" mime-type))
(button-put button :notmuch-redisplay-data part-args))
(apply #'notmuch-show-insert-bodypart-internal part-args)
(indent-rigidly part-beg
part-end
@@ -1106,14 +1125,18 @@ is t, hide the part initially and show the button."
(and deep button)
(and high button)
(and long button))))
(content-beg (point)))
(content-beg (point))
(part-data (list msg part mime-type nth depth button)))
;; Store the computed mime-type for later use (e.g. by attachment handlers).
(plist-put part :computed-type mime-type)
(if show-part
(notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
(cond
(show-part
(apply #'notmuch-show-insert-bodypart-internal part-data)
(when (and button (string-match "^image/" mime-type))
(button-put button :notmuch-redisplay-data part-data)))
(t
(when button
(button-put button :notmuch-lazy-part
(list msg part mime-type nth depth button))))
(button-put button :notmuch-lazy-part part-data))))
;; Some of the body part handlers leave point somewhere up in the
;; part, so we make sure that we're down at the end.
(goto-char (point-max))
@@ -2484,10 +2507,12 @@ kill-ring."
(defun notmuch-show-stash-mlarchive-link (&optional mla)
"Copy an ML Archive URI for the current message to the kill-ring.
This presumes that the message is available at the selected Mailing List Archive.
This presumes that the message is available at the selected
Mailing List Archive.
If optional argument MLA is non-nil, use the provided key instead of prompting
the user (see `notmuch-show-stash-mlarchive-link-alist')."
If optional argument MLA is non-nil, use the provided key instead
of prompting the user (see
`notmuch-show-stash-mlarchive-link-alist')."
(interactive)
(let ((url (cdr (assoc
(or mla
@@ -2504,12 +2529,15 @@ the user (see `notmuch-show-stash-mlarchive-link-alist')."
(concat url (notmuch-show-get-message-id t))))))
(defun notmuch-show-stash-mlarchive-link-and-go (&optional mla)
"Copy an ML Archive URI for the current message to the kill-ring and visit it.
"Copy an ML Archive URI for the current message to the
kill-ring and visit it.
This presumes that the message is available at the selected Mailing List Archive.
This presumes that the message is available at the selected
Mailing List Archive.
If optional argument MLA is non-nil, use the provided key instead of prompting
the user (see `notmuch-show-stash-mlarchive-link-alist')."
If optional argument MLA is non-nil, use the provided key instead
of prompting the user (see
`notmuch-show-stash-mlarchive-link-alist')."
(interactive)
(notmuch-show-stash-mlarchive-link mla)
(browse-url (current-kill 0 t)))

View File

@@ -159,7 +159,7 @@ place of the tag.
For example, to replace a tag with another string, simply use
that string as a formatting expression. To change the foreground
of a tag to red, use the expression
(propertize tag 'face '(:foreground \"red\"))
(propertize tag \\='face \\='(:foreground \"red\"))
See also `notmuch-tag-format-image', which can help replace tags
with images."
@@ -191,7 +191,7 @@ By default this shows deleted tags with strike-through in red,
unless strike-through is not available (e.g., emacs is running in
a terminal) in which case it uses inverse video. To hide deleted
tags completely set this to
'((\".*\" nil))
\\='((\".*\" nil))
See `notmuch-tag-formats' for full documentation."
:group 'notmuch-show
@@ -366,9 +366,9 @@ changed (the normal case) are shown using formats from
(defcustom notmuch-before-tag-hook nil
"Hooks that are run before tags of a message are modified.
'tag-changes' will contain the tags that are about to be added or removed as
`tag-changes' will contain the tags that are about to be added or removed as
a list of strings of the form \"+TAG\" or \"-TAG\".
'query' will be a string containing the search query that determines
`query' will be a string containing the search query that determines
the messages that are about to be tagged."
:type 'hook
:options '(notmuch-hl-line-mode)
@@ -377,9 +377,9 @@ the messages that are about to be tagged."
(defcustom notmuch-after-tag-hook nil
"Hooks that are run after tags of a message are modified.
'tag-changes' will contain the tags that were added or removed as
`tag-changes' will contain the tags that were added or removed as
a list of strings of the form \"+TAG\" or \"-TAG\".
'query' will be a string containing the search query that determines
`query' will be a string containing the search query that determines
the messages that were tagged."
:type 'hook
:options '(notmuch-hl-line-mode)

View File

@@ -200,7 +200,8 @@ Note that the author string should not contain whitespace
(defface notmuch-tree-match-tree-face
nil
"Face used in tree mode for the thread tree block graphics in messages matching the query."
"Face used in tree mode for the thread tree block graphics in
messages matching the query."
:group 'notmuch-tree
:group 'notmuch-faces)
@@ -239,7 +240,8 @@ Note that the author string should not contain whitespace
(defface notmuch-tree-no-match-tree-face
nil
"Face used in tree mode for the thread tree block graphics in messages matching the query."
"Face used in tree mode for the thread tree block graphics in
messages matching the query."
:group 'notmuch-tree
:group 'notmuch-faces)
@@ -1014,7 +1016,10 @@ unchanged ADDRESS if parsing fails."
A message tree is another name for a single sub-thread: i.e., a
message together with all its descendents."
(let ((msg (car tree))
(replies (cadr tree)))
(replies (cadr tree))
;; outline level, computed from the message's depth and
;; whether or not it's the first message in the tree.
(level (1+ (if (and (eq 0 depth) (not first)) 1 depth))))
(cond
((and (< 0 depth) (not last))
(push (alist-get 'vertical-tee notmuch-tree-thread-symbols) tree-status))
@@ -1034,6 +1039,7 @@ message together with all its descendents."
(setq msg (plist-put msg :first (and first (eq 0 depth))))
(setq msg (plist-put msg :tree-status tree-status))
(setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
(setq msg (plist-put msg :level level))
(notmuch-tree-goto-and-insert-msg msg)
(pop tree-status)
(pop tree-status)
@@ -1043,7 +1049,8 @@ message together with all its descendents."
(notmuch-tree-insert-thread replies (1+ depth) tree-status)))
(defun notmuch-tree-insert-thread (thread depth tree-status)
"Insert the collection of sibling sub-threads THREAD at depth DEPTH in the current forest."
"Insert the collection of sibling sub-threads THREAD at depth
DEPTH in the current forest."
(let ((n (length thread)))
(cl-loop for tree in thread
for count from 1 to n
@@ -1080,7 +1087,8 @@ Complete list of currently available key bindings:
(setq notmuch-buffer-refresh-function #'notmuch-tree-refresh-view)
(hl-line-mode 1)
(setq buffer-read-only t)
(setq truncate-lines t))
(setq truncate-lines t)
(when notmuch-tree-outline-enabled (notmuch-tree-outline-mode 1)))
(defvar notmuch-tree-process-exit-functions nil
"Functions called when the process inserting a tree of results finishes.
@@ -1278,6 +1286,180 @@ search results and that are also tagged with the given TAG."
nil
notmuch-search-oldest-first)))
;;; Tree outline mode
;;;; Custom variables
(defcustom notmuch-tree-outline-enabled nil
"Whether to automatically activate `notmuch-tree-outline-mode' in tree views."
:type 'boolean)
(defcustom notmuch-tree-outline-visibility 'hide-others
"Default state of the forest outline for `notmuch-tree-outline-mode'.
This variable controls the state of a forest initially and after
a movement command. If set to nil, all trees are displayed while
the symbol hide-all indicates that all trees in the forest should
be folded and hide-other that only the first one should be
unfolded."
:type '(choice (const :tag "Show all" nil)
(const :tag "Hide others" hide-others)
(const :tag "Hide all" hide-all)))
(defcustom notmuch-tree-outline-auto-close nil
"Close message and tree windows when moving past the last message."
:type 'boolean)
(defcustom notmuch-tree-outline-open-on-next nil
"Open new messages under point if they are closed when moving to next one.
When this flag is set, using the command
`notmuch-tree-outline-next' with point on a header for a new
message that is not shown will open its `notmuch-show' buffer
instead of moving point to next matching message."
:type 'boolean)
;;;; Helper functions
(defsubst notmuch-tree-outline--pop-at-end (pop-at-end)
(if notmuch-tree-outline-auto-close (not pop-at-end) pop-at-end))
(defun notmuch-tree-outline--set-visibility ()
(when (and notmuch-tree-outline-mode (> (point-max) (point-min)))
(cl-case notmuch-tree-outline-visibility
(hide-others (notmuch-tree-outline-hide-others))
(hide-all (outline-hide-body)))))
(defun notmuch-tree-outline--on-exit (proc)
(when (eq (process-status proc) 'exit)
(notmuch-tree-outline--set-visibility)))
(add-hook 'notmuch-tree-process-exit-functions #'notmuch-tree-outline--on-exit)
(defsubst notmuch-tree-outline--level (&optional props)
(or (plist-get (or props (notmuch-tree-get-message-properties)) :level) 0))
(defsubst notmuch-tree-outline--message-open-p ()
(and (buffer-live-p notmuch-tree-message-buffer)
(get-buffer-window notmuch-tree-message-buffer)
(let ((id (notmuch-tree-get-message-id)))
(and id
(with-current-buffer notmuch-tree-message-buffer
(string= (notmuch-show-get-message-id) id))))))
(defsubst notmuch-tree-outline--at-original-match-p ()
(and (notmuch-tree-get-prop :match)
(equal (notmuch-tree-get-prop :orig-tags)
(notmuch-tree-get-prop :tags))))
(defun notmuch-tree-outline--next (prev thread pop-at-end &optional open-new)
(cond (thread
(notmuch-tree-thread-top)
(if prev
(outline-backward-same-level 1)
(outline-forward-same-level 1))
(when (> (notmuch-tree-outline--level) 0) (outline-show-branches))
(notmuch-tree-outline--next nil nil pop-at-end t))
((and (or open-new notmuch-tree-outline-open-on-next)
(notmuch-tree-outline--at-original-match-p)
(not (notmuch-tree-outline--message-open-p)))
(notmuch-tree-outline-hide-others t))
(t (outline-next-visible-heading (if prev -1 1))
(unless (notmuch-tree-get-prop :match)
(notmuch-tree-matching-message prev pop-at-end))
(notmuch-tree-outline-hide-others t))))
;;;; User commands
(defun notmuch-tree-outline-hide-others (&optional and-show)
"Fold all threads except the one around point.
If AND-SHOW is t, make the current message visible if it's not."
(interactive)
(save-excursion
(while (and (not (bobp)) (> (notmuch-tree-outline--level) 1))
(outline-previous-heading))
(outline-hide-sublevels 1))
(when (> (notmuch-tree-outline--level) 0)
(outline-show-subtree)
(when and-show (notmuch-tree-show-message nil))))
(defun notmuch-tree-outline-next (&optional pop-at-end)
"Next matching message in a forest, taking care of thread visibility.
A prefix argument reverses the meaning of `notmuch-tree-outline-auto-close'."
(interactive "P")
(let ((pop (notmuch-tree-outline--pop-at-end pop-at-end)))
(if (null notmuch-tree-outline-visibility)
(notmuch-tree-matching-message nil pop)
(notmuch-tree-outline--next nil nil pop))))
(defun notmuch-tree-outline-previous (&optional pop-at-end)
"Previous matching message in forest, taking care of thread visibility.
With prefix, quit the tree view if there is no previous message."
(interactive "P")
(if (null notmuch-tree-outline-visibility)
(notmuch-tree-prev-matching-message pop-at-end)
(notmuch-tree-outline--next t nil pop-at-end)))
(defun notmuch-tree-outline-next-thread ()
"Next matching thread in forest, taking care of thread visibility."
(interactive)
(if (null notmuch-tree-outline-visibility)
(notmuch-tree-next-thread)
(notmuch-tree-outline--next nil t nil)))
(defun notmuch-tree-outline-previous-thread ()
"Previous matching thread in forest, taking care of thread visibility."
(interactive)
(if (null notmuch-tree-outline-visibility)
(notmuch-tree-prev-thread)
(notmuch-tree-outline--next t t nil)))
;;;; Mode definition
(defvar notmuch-tree-outline-mode-lighter nil
"The lighter mark for notmuch-tree-outline mode.
Usually empty since outline-minor-mode's lighter will be active.")
(define-minor-mode notmuch-tree-outline-mode
"Minor mode allowing message trees to be folded as outlines.
When this mode is set, each thread and subthread in the results
list is treated as a foldable section, with its first message as
its header.
The mode just makes available in the tree buffer all the
keybindings in `outline-minor-mode', and binds the following
additional keys:
\\{notmuch-tree-outline-mode-map}
The customizable variable `notmuch-tree-outline-visibility'
controls how navigation in the buffer is affected by this mode:
- If it is set to nil, `notmuch-tree-outline-previous',
`notmuch-tree-outline-next', and their thread counterparts
behave just as the corresponding notmuch-tree navigation keys
when this mode is not enabled.
- If, on the other hand, `notmuch-tree-outline-visibility' is
set to a non-nil value, these commands hiding the outlines of
the trees you are not reading as you move to new messages.
To enable notmuch-tree-outline-mode by default in all
notmuch-tree buffers, just set
`notmuch-tree-outline-mode-enabled' to t."
:lighter notmuch-tree-outline-mode-lighter
:keymap `((,(kbd "TAB") . outline-cycle)
(,(kbd "M-TAB") . outline-cycle-buffer)
("n" . notmuch-tree-outline-next)
("p" . notmuch-tree-outline-previous)
(,(kbd "M-n") . notmuch-tree-outline-next-thread)
(,(kbd "M-p") . notmuch-tree-outline-previous-thread))
(outline-minor-mode notmuch-tree-outline-mode)
(unless (derived-mode-p 'notmuch-tree-mode)
(user-error "notmuch-tree-outline-mode is only meaningful for notmuch trees!"))
(if notmuch-tree-outline-mode
(progn (setq-local outline-regexp "^[^\n]+")
(setq-local outline-level #'notmuch-tree-outline--level)
(notmuch-tree-outline--set-visibility))
(setq-local outline-regexp (default-value 'outline-regexp))
(setq-local outline-level (default-value 'outline-level))))
;;; _
(provide 'notmuch-tree)

View File

@@ -381,7 +381,7 @@ original filename the sender had."
(notmuch-wash-subject-to-filename subject 52)))
(defun notmuch-wash-convert-inline-patch-to-part (msg depth)
"Convert an inline patch into a fake 'text/x-diff' attachment.
"Convert an inline patch into a fake `text/x-diff' attachment.
Given that this function guesses whether a buffer includes a
patch and then guesses the extent of the patch, there is scope