update packages
This commit is contained in:
@@ -33,10 +33,11 @@
|
||||
(declare-function notmuch-poll "notmuch-lib" ())
|
||||
(declare-function notmuch-tree "notmuch-tree"
|
||||
(&optional query query-context target buffer-name
|
||||
open-target unthreaded parent-buffer oldest-first))
|
||||
open-target unthreaded parent-buffer
|
||||
oldest-first hide-excluded))
|
||||
(declare-function notmuch-unthreaded "notmuch-tree"
|
||||
(&optional query query-context target buffer-name
|
||||
open-target))
|
||||
open-target oldest-first hide-excluded))
|
||||
|
||||
|
||||
;;; Options
|
||||
@@ -115,6 +116,12 @@ searches so they still work in customize."
|
||||
(const :tag "Default" nil)
|
||||
(const :tag "Oldest-first" oldest-first)
|
||||
(const :tag "Newest-first" newest-first)))
|
||||
(group :format "%v" :inline t
|
||||
(const :format "" :excluded)
|
||||
(choice :tag " Hide Excluded"
|
||||
(const :tag "Default" nil)
|
||||
(const :tag "Hide" hide)
|
||||
(const :tag "Show" show)))
|
||||
(group :format "%v" :inline t
|
||||
(const :format "" :search-type)
|
||||
(choice :tag " Search Type"
|
||||
@@ -143,6 +150,10 @@ a plist. Supported properties are
|
||||
:sort-order Specify the sort order to be used for the search.
|
||||
Possible values are `oldest-first', `newest-first'
|
||||
or nil. Nil means use the default sort order.
|
||||
:excluded Whether to show mail with excluded tags in the
|
||||
search. Possible values are `hide', `show',
|
||||
or nil. Nil means use the default value of
|
||||
`notmuch-search-hide-excluded'.
|
||||
: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
|
||||
@@ -484,19 +495,19 @@ diagonal."
|
||||
append (notmuch-hello-reflect-generate-row ncols nrows row list))))
|
||||
|
||||
(defun notmuch-hello-widget-search (widget &rest _ignore)
|
||||
(cl-case (widget-get widget :notmuch-search-type)
|
||||
(tree
|
||||
(let ((n (notmuch-search-format-buffer-name (widget-value widget) "tree" t)))
|
||||
(notmuch-tree (widget-get widget :notmuch-search-terms)
|
||||
nil nil n nil nil nil
|
||||
(widget-get widget :notmuch-search-oldest-first))))
|
||||
(unthreaded
|
||||
(let ((n (notmuch-search-format-buffer-name (widget-value widget)
|
||||
"unthreaded" t)))
|
||||
(notmuch-unthreaded (widget-get widget :notmuch-search-terms) nil nil n)))
|
||||
(t
|
||||
(notmuch-search (widget-get widget :notmuch-search-terms)
|
||||
(widget-get widget :notmuch-search-oldest-first)))))
|
||||
(let ((search-terms (widget-get widget :notmuch-search-terms))
|
||||
(oldest-first (widget-get widget :notmuch-search-oldest-first))
|
||||
(exclude (widget-get widget :notmuch-search-hide-excluded)))
|
||||
(cl-case (widget-get widget :notmuch-search-type)
|
||||
(tree
|
||||
(let ((n (notmuch-search-format-buffer-name (widget-value widget) "tree" t)))
|
||||
(notmuch-tree search-terms nil nil n nil nil nil oldest-first exclude)))
|
||||
(unthreaded
|
||||
(let ((n (notmuch-search-format-buffer-name (widget-value widget)
|
||||
"unthreaded" t)))
|
||||
(notmuch-unthreaded search-terms nil nil n nil oldest-first exclude)))
|
||||
(t
|
||||
(notmuch-search search-terms oldest-first exclude)))))
|
||||
|
||||
(defun notmuch-saved-search-count (search)
|
||||
(car (notmuch--process-lines notmuch-command "count" search)))
|
||||
@@ -643,6 +654,10 @@ with `notmuch-hello-query-counts'."
|
||||
(newest-first nil)
|
||||
(oldest-first t)
|
||||
(otherwise notmuch-search-oldest-first)))
|
||||
(exclude (cl-case (plist-get elem :excluded)
|
||||
(hide t)
|
||||
(show nil)
|
||||
(otherwise notmuch-search-hide-excluded)))
|
||||
(search-type (plist-get elem :search-type))
|
||||
(msg-count (plist-get elem :count)))
|
||||
(widget-insert (format "%8s "
|
||||
@@ -652,6 +667,7 @@ with `notmuch-hello-query-counts'."
|
||||
:notmuch-search-terms query
|
||||
:notmuch-search-oldest-first oldest-first
|
||||
:notmuch-search-type search-type
|
||||
:notmuch-search-hide-excluded exclude
|
||||
name)
|
||||
(setq column-indent
|
||||
(1+ (max 0 (- column-width (length name)))))))
|
||||
@@ -694,11 +710,7 @@ with `notmuch-hello-query-counts'."
|
||||
;; configuration change, and this is not a new window)
|
||||
(setq do-refresh t)))))
|
||||
(when (and do-refresh notmuch-hello-auto-refresh)
|
||||
;; Refresh hello as soon as we get back to redisplay. On Emacs
|
||||
;; 24, we can't do it right here because something in this
|
||||
;; hook's call stack overrides hello's point placement.
|
||||
;; FIXME And on Emacs releases that we still support?
|
||||
(run-at-time nil nil #'notmuch-hello t))
|
||||
(notmuch-hello t))
|
||||
(unless hello-buf
|
||||
;; Clean up hook
|
||||
(remove-hook 'window-configuration-change-hook
|
||||
|
||||
@@ -50,15 +50,21 @@ fast way to jump to a saved search from anywhere in Notmuch."
|
||||
(cl-case (plist-get saved-search :sort-order)
|
||||
(newest-first nil)
|
||||
(oldest-first t)
|
||||
(otherwise (default-value 'notmuch-search-oldest-first)))))
|
||||
(otherwise (default-value 'notmuch-search-oldest-first))))
|
||||
(exclude (cl-case (plist-get saved-search :excluded)
|
||||
(hide t)
|
||||
(show nil)
|
||||
(otherwise notmuch-search-hide-excluded))))
|
||||
(push (list key name
|
||||
(cond
|
||||
((eq (plist-get saved-search :search-type) 'tree)
|
||||
(lambda () (notmuch-tree query)))
|
||||
(lambda () (notmuch-tree query nil nil nil nil nil nil
|
||||
oldest-first exclude)))
|
||||
((eq (plist-get saved-search :search-type) 'unthreaded)
|
||||
(lambda () (notmuch-unthreaded query)))
|
||||
(lambda () (notmuch-unthreaded query nil nil nil nil
|
||||
oldest-first exclude)))
|
||||
(t
|
||||
(lambda () (notmuch-search query oldest-first)))))
|
||||
(lambda () (notmuch-search query oldest-first exclude)))))
|
||||
action-map)))))
|
||||
(setq action-map (nreverse action-map))
|
||||
(if action-map
|
||||
|
||||
@@ -105,6 +105,16 @@ search."
|
||||
:group 'notmuch-search)
|
||||
(make-variable-buffer-local 'notmuch-search-oldest-first)
|
||||
|
||||
(defcustom notmuch-search-hide-excluded t
|
||||
"Hide mail tagged with a excluded tag.
|
||||
|
||||
Excluded tags are defined in the users configuration file under
|
||||
the search section. When this variable is true, any mail with
|
||||
such a tag will not be shown in the search output."
|
||||
:type 'boolean
|
||||
:group 'notmuch-search)
|
||||
(make-variable-buffer-local 'notmuch-search-hide-excluded)
|
||||
|
||||
(defcustom notmuch-poll-script nil
|
||||
"[Deprecated] Command to run to incorporate new mail into the notmuch database.
|
||||
|
||||
|
||||
@@ -145,14 +145,16 @@ Otherwise set it according to `notmuch-fcc-dirs'."
|
||||
|
||||
(defmacro with-temporary-notmuch-message-buffer (&rest body)
|
||||
"Set-up a temporary copy of the current message-mode buffer."
|
||||
`(let ((case-fold-search t)
|
||||
(buf (current-buffer))
|
||||
(mml-externalize-attachments message-fcc-externalize-attachments))
|
||||
(with-current-buffer (get-buffer-create " *message temp*")
|
||||
(message-clone-locals buf) ;; for message-encoded-mail-cache
|
||||
(erase-buffer)
|
||||
(insert-buffer-substring buf)
|
||||
,@body)))
|
||||
`(save-restriction
|
||||
(widen)
|
||||
(let ((case-fold-search t)
|
||||
(buf (current-buffer))
|
||||
(mml-externalize-attachments message-fcc-externalize-attachments))
|
||||
(with-current-buffer (get-buffer-create " *message temp*")
|
||||
(message-clone-locals buf) ;; for message-encoded-mail-cache
|
||||
(erase-buffer)
|
||||
(insert-buffer-substring buf)
|
||||
,@body))))
|
||||
|
||||
(defun notmuch-maildir-setup-message-for-saving ()
|
||||
"Setup message for saving.
|
||||
|
||||
@@ -142,6 +142,16 @@ to `notmuch-mua-send-hook'."
|
||||
:type 'regexp
|
||||
:group 'notmuch-send)
|
||||
|
||||
(defcustom notmuch-mua-subject-regexp
|
||||
"[[:blank:]]*$"
|
||||
"Message subject indicating that something may be amiss.
|
||||
By default, this checks for empty subject lines.
|
||||
|
||||
This is not used unless `notmuch-mua-subject-check' is added to
|
||||
`notmuch-mua-send-hook'."
|
||||
:type 'regexp
|
||||
:group 'notmuch-send)
|
||||
|
||||
;;; Various functions
|
||||
|
||||
(defun notmuch-mua-attachment-check ()
|
||||
@@ -179,6 +189,19 @@ Typically this is added to `notmuch-mua-send-hook'."
|
||||
;; ...signal an error.
|
||||
(error "Missing attachment")))
|
||||
|
||||
(defun notmuch-mua-subject-check ()
|
||||
"Signal an error if the subject seems amiss.
|
||||
More precisely, if the subject conforms to
|
||||
`notmuch-mua-subject-regexp'.
|
||||
|
||||
Typically this is added to `notmuch-mua-send-hook'."
|
||||
(or (save-excursion
|
||||
(message-goto-subject)
|
||||
(message-beginning-of-header t)
|
||||
(not (looking-at-p notmuch-mua-subject-regexp)))
|
||||
(y-or-n-p "Subject may be erroneous – is that okay?")
|
||||
(error "Erroneous subject")))
|
||||
|
||||
(defun notmuch-mua-get-switch-function ()
|
||||
"Get a switch function according to `notmuch-mua-compose-in'."
|
||||
(pcase notmuch-mua-compose-in
|
||||
@@ -401,6 +424,7 @@ instead of `message-mode' and SWITCH-FUNCTION is mandatory."
|
||||
(addr (and good-tokens (mapconcat #'identity good-tokens ", "))))
|
||||
(message-replace-header header addr))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun notmuch-mua-mail (&optional to subject other-headers _continue
|
||||
switch-function yank-action send-actions
|
||||
return-action &rest _ignored)
|
||||
@@ -622,20 +646,24 @@ unencrypted. Really send? "))))
|
||||
(message-send-and-exit arg)
|
||||
(message-send arg)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun notmuch-mua-send-and-exit (&optional arg)
|
||||
(interactive "P")
|
||||
(notmuch-mua-send-common arg t))
|
||||
|
||||
;;;###autoload
|
||||
(defun notmuch-mua-send (&optional arg)
|
||||
(interactive "P")
|
||||
(notmuch-mua-send-common arg))
|
||||
|
||||
;;;###autoload
|
||||
(defun notmuch-mua-kill-buffer ()
|
||||
(interactive)
|
||||
(message-kill-buffer))
|
||||
|
||||
;;; _
|
||||
|
||||
;;;###autoload
|
||||
(define-mail-user-agent 'notmuch-user-agent
|
||||
'notmuch-mua-mail
|
||||
'notmuch-mua-send-and-exit
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(define-package "notmuch" "20231006.2337" "run notmuch within emacs" 'nil :commit "e4ead7656c72092bf30c43283057c2d4c4107962" :url "https://notmuchmail.org")
|
||||
(define-package "notmuch" "20250218.1254" "run notmuch within emacs" 'nil :commit "0e10ca3a625c25c0238ecca2767aab7035b88a22" :url "https://notmuchmail.org")
|
||||
;; Local Variables:
|
||||
;; no-byte-compile: t
|
||||
;; End:
|
||||
|
||||
@@ -864,7 +864,7 @@ will return nil if the CID is unknown or cannot be retrieved."
|
||||
(unless (icalendar-import-buffer file t)
|
||||
(error "Icalendar import error. %s"
|
||||
"See *icalendar-errors* for more information"))
|
||||
(set-buffer (get-file-buffer file))
|
||||
(set-buffer (find-buffer-visiting file))
|
||||
(setq result (buffer-substring (point-min) (point-max)))
|
||||
(set-buffer-modified-p nil)
|
||||
(kill-buffer (current-buffer)))
|
||||
@@ -2686,7 +2686,9 @@ This function is used as a value for
|
||||
`imenu-prev-index-position-function'."
|
||||
(if (bobp)
|
||||
nil
|
||||
(notmuch-show-previous-message)
|
||||
(if (eobp)
|
||||
(notmuch-show-move-to-message-top)
|
||||
(notmuch-show-goto-message-previous))
|
||||
t))
|
||||
|
||||
(defun notmuch-show-imenu-extract-index-name-function ()
|
||||
|
||||
@@ -374,6 +374,7 @@ then NAME behaves like CMD."
|
||||
(define-key map [remap notmuch-jump-search] 'notmuch-tree-jump-search)
|
||||
|
||||
(define-key map "o" 'notmuch-tree-toggle-order)
|
||||
(define-key map "i" 'notmuch-tree-toggle-hide-excluded)
|
||||
(define-key map "S" 'notmuch-search-from-tree-current-query)
|
||||
(define-key map "U" 'notmuch-unthreaded-from-tree-current-query)
|
||||
(define-key map "Z" 'notmuch-tree-from-unthreaded-current-query)
|
||||
@@ -590,7 +591,9 @@ NOT change the database."
|
||||
"Call notmuch search with the current query."
|
||||
(interactive)
|
||||
(notmuch-tree-close-message-window)
|
||||
(notmuch-search (notmuch-tree-get-query)))
|
||||
(notmuch-search (notmuch-tree-get-query)
|
||||
notmuch-search-oldest-first
|
||||
notmuch-search-hide-excluded))
|
||||
|
||||
(defun notmuch-tree-message-window-kill-hook ()
|
||||
"Close the message pane when exiting the show buffer."
|
||||
@@ -803,7 +806,8 @@ nil otherwise."
|
||||
target
|
||||
nil
|
||||
unthreaded
|
||||
notmuch-search-oldest-first)))
|
||||
notmuch-search-oldest-first
|
||||
notmuch-search-hide-excluded)))
|
||||
|
||||
(defun notmuch-tree-thread-top ()
|
||||
(when (notmuch-tree-get-message-properties)
|
||||
@@ -942,7 +946,9 @@ unchanged ADDRESS if parsing fails."
|
||||
'face face)))
|
||||
|
||||
((string-equal field "subject")
|
||||
(let ((bare-subject (notmuch-show-strip-re (plist-get headers :Subject)))
|
||||
(let ((bare-subject
|
||||
(notmuch-sanitize
|
||||
(notmuch-show-strip-re (plist-get headers :Subject))))
|
||||
(previous-subject notmuch-tree-previous-subject)
|
||||
(face (if match
|
||||
'notmuch-tree-match-subject-face
|
||||
@@ -1133,7 +1139,8 @@ object, and with the tree results buffer as the current buffer.")
|
||||
results-buf)))))
|
||||
|
||||
(defun notmuch-tree-worker (basic-query &optional query-context target
|
||||
open-target unthreaded oldest-first)
|
||||
open-target unthreaded oldest-first
|
||||
exclude)
|
||||
"Insert the tree view of the search in the current buffer.
|
||||
|
||||
This is is a helper function for notmuch-tree. The arguments are
|
||||
@@ -1142,6 +1149,7 @@ the same as for the function notmuch-tree."
|
||||
(notmuch-tree-mode)
|
||||
(add-hook 'post-command-hook #'notmuch-tree-command-hook t t)
|
||||
(setq notmuch-search-oldest-first oldest-first)
|
||||
(setq notmuch-search-hide-excluded exclude)
|
||||
(setq notmuch-tree-unthreaded unthreaded)
|
||||
(setq notmuch-tree-basic-query basic-query)
|
||||
(setq notmuch-tree-query-context (if (or (string= query-context "")
|
||||
@@ -1161,14 +1169,15 @@ the same as for the function notmuch-tree."
|
||||
(and query-context
|
||||
(concat " and (" query-context ")"))))
|
||||
(sort-arg (if oldest-first "--sort=oldest-first" "--sort=newest-first"))
|
||||
(message-arg (if unthreaded "--unthreaded" "--entire-thread")))
|
||||
(message-arg (if unthreaded "--unthreaded" "--entire-thread"))
|
||||
(exclude-arg (if exclude "--exclude=true" "--exclude=false")))
|
||||
(when (equal (car (notmuch--process-lines notmuch-command "count" search-args)) "0")
|
||||
(setq search-args basic-query))
|
||||
(notmuch-tag-clear-cache)
|
||||
(let ((proc (notmuch-start-notmuch
|
||||
"notmuch-tree" (current-buffer) #'notmuch-tree-process-sentinel
|
||||
"show" "--body=false" "--format=sexp" "--format-version=5"
|
||||
sort-arg message-arg search-args))
|
||||
sort-arg message-arg exclude-arg search-args))
|
||||
;; Use a scratch buffer to accumulate partial output.
|
||||
;; This buffer will be killed by the sentinel, which
|
||||
;; should be called no matter how the process dies.
|
||||
@@ -1195,8 +1204,19 @@ default sort order is defined by `notmuch-search-oldest-first'."
|
||||
(setq notmuch-search-oldest-first (not notmuch-search-oldest-first))
|
||||
(notmuch-tree-refresh-view))
|
||||
|
||||
(defun notmuch-tree-toggle-hide-excluded ()
|
||||
"Toggle whether to hide excluded messages.
|
||||
|
||||
This command toggles whether to hide excluded messages for the current
|
||||
search. The default value for this is defined by `notmuch-search-hide-excluded'."
|
||||
(interactive)
|
||||
(setq notmuch-search-hide-excluded (not notmuch-search-hide-excluded))
|
||||
(notmuch-tree-refresh-view))
|
||||
|
||||
;;;###autoload
|
||||
(defun notmuch-tree (&optional query query-context target buffer-name
|
||||
open-target unthreaded parent-buffer oldest-first)
|
||||
open-target unthreaded parent-buffer
|
||||
oldest-first hide-excluded)
|
||||
"Display threads matching QUERY in tree view.
|
||||
|
||||
The arguments are:
|
||||
@@ -1211,7 +1231,15 @@ The arguments are:
|
||||
it is nil \"*notmuch-tree\" followed by QUERY is used.
|
||||
OPEN-TARGET: If TRUE open the target message in the message pane.
|
||||
UNTHREADED: If TRUE only show matching messages in an unthreaded view."
|
||||
(interactive)
|
||||
(interactive
|
||||
(list
|
||||
;; Prompt for a query
|
||||
nil
|
||||
;; Fill other args with nil.
|
||||
nil nil nil nil nil nil
|
||||
;; Populate these from the default value of these options.
|
||||
(default-value 'notmuch-search-oldest-first)
|
||||
(default-value 'notmuch-search-hide-excluded)))
|
||||
(unless query
|
||||
(setq query (notmuch-read-query (concat "Notmuch "
|
||||
(if unthreaded "unthreaded " "tree ")
|
||||
@@ -1225,17 +1253,27 @@ The arguments are:
|
||||
(pop-to-buffer-same-window buffer))
|
||||
;; Don't track undo information for this buffer
|
||||
(setq buffer-undo-list t)
|
||||
(notmuch-tree-worker query query-context target open-target unthreaded oldest-first)
|
||||
(notmuch-tree-worker query query-context target open-target
|
||||
unthreaded oldest-first hide-excluded)
|
||||
(setq notmuch-tree-parent-buffer parent-buffer)
|
||||
(setq truncate-lines t))
|
||||
|
||||
(defun notmuch-unthreaded (&optional query query-context target buffer-name
|
||||
open-target)
|
||||
open-target oldest-first hide-excluded)
|
||||
"Display threads matching QUERY in unthreaded view.
|
||||
|
||||
See function NOTMUCH-TREE for documentation of the arguments"
|
||||
(interactive)
|
||||
(notmuch-tree query query-context target buffer-name open-target t))
|
||||
(interactive
|
||||
(list
|
||||
;; Prompt for a query
|
||||
nil
|
||||
;; Fill other args with nil.
|
||||
nil nil nil nil
|
||||
;; Populate these from the default value of these options.
|
||||
(default-value 'notmuch-search-oldest-first)
|
||||
(default-value 'notmuch-search-hide-excluded)))
|
||||
(notmuch-tree query query-context target buffer-name open-target
|
||||
t nil oldest-first hide-excluded))
|
||||
|
||||
(defun notmuch-tree-filter (query)
|
||||
"Filter or LIMIT the current search results based on an additional query string.
|
||||
@@ -1269,7 +1307,8 @@ search results and that are also tagged with the given TAG."
|
||||
nil
|
||||
notmuch-tree-unthreaded
|
||||
nil
|
||||
notmuch-search-oldest-first)))
|
||||
notmuch-search-oldest-first
|
||||
notmuch-search-hide-excluded)))
|
||||
|
||||
(defun notmuch-tree-edit-search (query)
|
||||
"Edit the current search"
|
||||
|
||||
@@ -187,6 +187,7 @@ there will be called at other points of notmuch execution."
|
||||
(define-key map "r" 'notmuch-search-reply-to-thread-sender)
|
||||
(define-key map "R" 'notmuch-search-reply-to-thread)
|
||||
(define-key map "o" 'notmuch-search-toggle-order)
|
||||
(define-key map "i" 'notmuch-search-toggle-hide-excluded)
|
||||
(define-key map "c" 'notmuch-search-stash-map)
|
||||
(define-key map "t" 'notmuch-search-filter-by-tag)
|
||||
(define-key map "l" 'notmuch-search-filter)
|
||||
@@ -550,12 +551,18 @@ Return non-nil on success."
|
||||
(defun notmuch-tree-from-search-current-query ()
|
||||
"Tree view of current query."
|
||||
(interactive)
|
||||
(notmuch-tree notmuch-search-query-string))
|
||||
(notmuch-tree notmuch-search-query-string
|
||||
nil nil nil nil nil nil
|
||||
notmuch-search-oldest-first
|
||||
notmuch-search-hide-excluded))
|
||||
|
||||
(defun notmuch-unthreaded-from-search-current-query ()
|
||||
"Unthreaded view of current query."
|
||||
(interactive)
|
||||
(notmuch-unthreaded notmuch-search-query-string))
|
||||
(notmuch-unthreaded notmuch-search-query-string
|
||||
nil nil nil nil
|
||||
notmuch-search-oldest-first
|
||||
notmuch-search-hide-excluded))
|
||||
|
||||
(defun notmuch-tree-from-search-thread ()
|
||||
"Show the selected thread with notmuch-tree."
|
||||
@@ -564,7 +571,9 @@ Return non-nil on success."
|
||||
notmuch-search-query-string
|
||||
nil
|
||||
(notmuch-prettify-subject (notmuch-search-find-subject))
|
||||
t nil (current-buffer)))
|
||||
t nil (current-buffer)
|
||||
notmuch-search-oldest-first
|
||||
notmuch-search-hide-excluded))
|
||||
|
||||
(defun notmuch-search-reply-to-thread (&optional prompt-for-sender)
|
||||
"Begin composing a reply-all to the entire current thread in a new buffer."
|
||||
@@ -1035,14 +1044,16 @@ PROMPT is the string to prompt with."
|
||||
|
||||
(put 'notmuch-search 'notmuch-doc "Search for messages.")
|
||||
;;;###autoload
|
||||
(defun notmuch-search (&optional query oldest-first target-thread target-line
|
||||
no-display)
|
||||
(defun notmuch-search (&optional query oldest-first hide-excluded target-thread
|
||||
target-line no-display)
|
||||
"Display threads matching QUERY in a notmuch-search buffer.
|
||||
|
||||
If QUERY is nil, it is read interactively from the minibuffer.
|
||||
Other optional parameters are used as follows:
|
||||
|
||||
OLDEST-FIRST: A Boolean controlling the sort order of returned threads
|
||||
HIDE-EXCLUDED: A boolean controlling whether to omit threads with excluded
|
||||
tags.
|
||||
TARGET-THREAD: A thread ID (without the thread: prefix) that will be made
|
||||
current if it appears in the search results.
|
||||
TARGET-LINE: The line number to move to if the target thread does not
|
||||
@@ -1057,9 +1068,10 @@ the configured default sort order."
|
||||
(list
|
||||
;; Prompt for a query
|
||||
nil
|
||||
;; Use the default search order (if we're doing a search from a
|
||||
;; search buffer, ignore any buffer-local overrides)
|
||||
(default-value 'notmuch-search-oldest-first)))
|
||||
;; Use the default search order and exclude value (if we're doing a
|
||||
;; search from a search buffer, ignore any buffer-local overrides)
|
||||
(default-value 'notmuch-search-oldest-first)
|
||||
(default-value 'notmuch-search-hide-excluded)))
|
||||
|
||||
(let* ((query (or query (notmuch-read-query "Notmuch search: ")))
|
||||
(buffer (get-buffer-create (notmuch-search-buffer-title query))))
|
||||
@@ -1073,6 +1085,7 @@ the configured default sort order."
|
||||
(setq notmuch-search-oldest-first oldest-first)
|
||||
(setq notmuch-search-target-thread target-thread)
|
||||
(setq notmuch-search-target-line target-line)
|
||||
(setq notmuch-search-hide-excluded hide-excluded)
|
||||
(notmuch-tag-clear-cache)
|
||||
(when (get-buffer-process buffer)
|
||||
(error "notmuch search process already running for query `%s'" query))
|
||||
@@ -1086,6 +1099,9 @@ the configured default sort order."
|
||||
(if oldest-first
|
||||
"--sort=oldest-first"
|
||||
"--sort=newest-first")
|
||||
(if hide-excluded
|
||||
"--exclude=true"
|
||||
"--exclude=false")
|
||||
query)))
|
||||
;; Use a scratch buffer to accumulate partial output.
|
||||
;; This buffer will be killed by the sentinel, which
|
||||
@@ -1106,11 +1122,21 @@ same relative position within the new buffer."
|
||||
(interactive)
|
||||
(notmuch-search notmuch-search-query-string
|
||||
notmuch-search-oldest-first
|
||||
notmuch-search-hide-excluded
|
||||
(notmuch-search-find-thread-id 'bare)
|
||||
(line-number-at-pos)
|
||||
t)
|
||||
(goto-char (point-min)))
|
||||
|
||||
(defun notmuch-search-toggle-hide-excluded ()
|
||||
"Toggle whether to hide excluded messages.
|
||||
|
||||
This command toggles whether to hide excluded messages for the current
|
||||
search. The default value for this is defined by `notmuch-search-hide-excluded'."
|
||||
(interactive)
|
||||
(setq notmuch-search-hide-excluded (not notmuch-search-hide-excluded))
|
||||
(notmuch-search-refresh-view))
|
||||
|
||||
(defun notmuch-search-toggle-order ()
|
||||
"Toggle the current search order.
|
||||
|
||||
@@ -1139,7 +1165,8 @@ current search results AND the additional query string provided."
|
||||
(notmuch-search (if (string= grouped-original-query "*")
|
||||
grouped-query
|
||||
(concat grouped-original-query " and " grouped-query))
|
||||
notmuch-search-oldest-first)))
|
||||
notmuch-search-oldest-first
|
||||
notmuch-search-hide-excluded)))
|
||||
|
||||
(defun notmuch-search-filter-by-tag (tag)
|
||||
"Filter the current search results based on a single TAG.
|
||||
@@ -1150,13 +1177,16 @@ search results and that are also tagged with the given TAG."
|
||||
(list (notmuch-select-tag-with-completion "Filter by tag: "
|
||||
notmuch-search-query-string)))
|
||||
(notmuch-search (concat notmuch-search-query-string " and tag:" tag)
|
||||
notmuch-search-oldest-first))
|
||||
notmuch-search-oldest-first
|
||||
notmuch-search-hide-excluded))
|
||||
|
||||
(defun notmuch-search-by-tag (tag)
|
||||
"Display threads matching TAG in a notmuch-search buffer."
|
||||
(interactive
|
||||
(list (notmuch-select-tag-with-completion "Notmuch search tag: ")))
|
||||
(notmuch-search (concat "tag:" tag)))
|
||||
(notmuch-search (concat "tag:" tag)
|
||||
(default-value 'notmuch-search-oldest-first)
|
||||
(default-value 'notmuch-search-hide-excluded)))
|
||||
|
||||
(defun notmuch-search-edit-search (query)
|
||||
"Edit the current search"
|
||||
|
||||
Reference in New Issue
Block a user