summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-02-15 22:53:27 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-02-16 11:32:59 -0700
commitcd34eb96899f9cbe6946d09ac13ea3d7ee8d1941 (patch)
tree9973117ba16013c95cb5c3a002dfc3c1ec1da527
parent0456c87148b5215fc5894caa770ca83aa37c9626 (diff)
downloaddotfiles-cd34eb96899f9cbe6946d09ac13ea3d7ee8d1941.tar.gz
factor out spw/notmuch-show-stable-matching-query
-rw-r--r--.emacs.d/notmuch-config.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/.emacs.d/notmuch-config.el b/.emacs.d/notmuch-config.el
index a8976d1d..51e19392 100644
--- a/.emacs.d/notmuch-config.el
+++ b/.emacs.d/notmuch-config.el
@@ -249,6 +249,15 @@ Two ways to read:
query)
0))
+(defun spw/notmuch-show-stable-matching-query ()
+ (let (ids)
+ (notmuch-show-mapc
+ (lambda ()
+ (let ((props (notmuch-show-get-message-properties)))
+ (when (plist-get props :match)
+ (push (concat "id:" (plist-get props :id)) ids)))))
+ (string-join ids " ")))
+
(cl-flet* ((connective (word)
(apply-partially
(lambda (connec &rest queries)
@@ -419,14 +428,7 @@ Two ways to read:
(cl-ecase major-mode
(notmuch-search-mode
(car (notmuch-search-find-stable-query)))
- (notmuch-show-mode
- (let (ids)
- (notmuch-show-mapc
- (lambda ()
- (let ((props (notmuch-show-get-message-properties)))
- (when (plist-get props :match)
- (push (concat "id:" (plist-get props :id)) ids)))))
- (string-join ids " ")))))
+ (notmuch-show-mode (spw/notmuch-show-stable-matching-query))))
(method-buffer (or notmuch-show-parent-buffer (current-buffer)))
(catchup-method (and (buffer-local-boundp
'spw/notmuch-catchup-method method-buffer)
@@ -499,9 +501,8 @@ scroll through them."
(when (and notmuch-show-thread-id notmuch-archive-tags)
;; only tag messages which would have been expanded when we opened
;; the thread
- (notmuch-tag
- (conjoin notmuch-show-query-context notmuch-show-thread-id)
- (notmuch-tag-change-list notmuch-archive-tags nil))
+ (notmuch-tag (spw/notmuch-show-stable-matching-query)
+ (notmuch-tag-change-list notmuch-archive-tags nil))
(notmuch-show-next-thread t))
(notmuch-show-next-thread-show)))))