mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
emacs: add a filter option to show
Show the current thread with a different filter (i.e., open messages in the thread matching the new query). Bound to 'l' for "limit". Note that it is not the same as filter in search mode as it replaces the existing query rather than ANDing with it (but it does keep the thread-id part of the query).
This commit is contained in:
parent
d4053be21a
commit
2982d70ac6
1 changed files with 12 additions and 0 deletions
|
@ -47,6 +47,7 @@
|
||||||
(declare-function notmuch-tree "notmuch-tree"
|
(declare-function notmuch-tree "notmuch-tree"
|
||||||
(&optional query query-context target buffer-name open-target))
|
(&optional query query-context target buffer-name open-target))
|
||||||
(declare-function notmuch-tree-get-message-properties "notmuch-tree" nil)
|
(declare-function notmuch-tree-get-message-properties "notmuch-tree" nil)
|
||||||
|
(declare-function notmuch-read-query "notmuch" (prompt))
|
||||||
|
|
||||||
(defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
|
(defcustom notmuch-message-headers '("Subject" "To" "Cc" "Date")
|
||||||
"Headers that should be shown in a message, in this order.
|
"Headers that should be shown in a message, in this order.
|
||||||
|
@ -1372,6 +1373,7 @@ reset based on the original query."
|
||||||
(define-key map (kbd "<backtab>") 'notmuch-show-previous-button)
|
(define-key map (kbd "<backtab>") 'notmuch-show-previous-button)
|
||||||
(define-key map (kbd "TAB") 'notmuch-show-next-button)
|
(define-key map (kbd "TAB") 'notmuch-show-next-button)
|
||||||
(define-key map "f" 'notmuch-show-forward-message)
|
(define-key map "f" 'notmuch-show-forward-message)
|
||||||
|
(define-key map "l" 'notmuch-show-filter-thread)
|
||||||
(define-key map "r" 'notmuch-show-reply-sender)
|
(define-key map "r" 'notmuch-show-reply-sender)
|
||||||
(define-key map "R" 'notmuch-show-reply)
|
(define-key map "R" 'notmuch-show-reply)
|
||||||
(define-key map "|" 'notmuch-show-pipe-message)
|
(define-key map "|" 'notmuch-show-pipe-message)
|
||||||
|
@ -1660,6 +1662,16 @@ user decision and we should not override it."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(funcall notmuch-show-mark-read-function (window-start) (window-end)))))
|
(funcall notmuch-show-mark-read-function (window-start) (window-end)))))
|
||||||
|
|
||||||
|
(defun notmuch-show-filter-thread (query)
|
||||||
|
"Filter or LIMIT the current thread based on a new query string.
|
||||||
|
|
||||||
|
Reshows the current thread with matches defined by the new query-string."
|
||||||
|
(interactive (list (notmuch-read-query "Filter thread: ")))
|
||||||
|
(let ((msg-id (notmuch-show-get-message-id)))
|
||||||
|
(setq notmuch-show-query-context (if (string= query "") nil query))
|
||||||
|
(notmuch-show-refresh-view t)
|
||||||
|
(notmuch-show-goto-message msg-id)))
|
||||||
|
|
||||||
;; Functions for getting attributes of several messages in the current
|
;; Functions for getting attributes of several messages in the current
|
||||||
;; thread.
|
;; thread.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue