summaryrefslogtreecommitdiffhomepage
path: root/lib/net
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-08-25 05:39:24 +0100
committerjao <jao@gnu.org>2022-08-25 05:40:16 +0100
commitb9a96c85d271b99f13fa0f1ec10fb1dd38694013 (patch)
tree3283b7d052f7913073beead1915b4725b46cf5fa /lib/net
parent017092ceffb6b582f9a14addd536f32224cc923b (diff)
downloadelibs-b9a96c85d271b99f13fa0f1ec10fb1dd38694013.tar.gz
elibs-b9a96c85d271b99f13fa0f1ec10fb1dd38694013.tar.bz2
jao-notmuch: next (tree) message command for searches sans tag:new
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/jao-notmuch.el26
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index f8a4648..11b239f 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -54,12 +54,6 @@
(notmuch-tree-close-message-window)
(notmuch-tree-show-message nil)))
-(defun jao-notmuch-click-message-buffer ()
- (interactive)
- (let ((b (current-buffer)))
- (unless (eq 'url (jao-notmuch-goto-message-buffer t t))
- (pop-to-buffer b))))
-
(defun jao-notmuch-tree--find-tree-buffer ()
(or jao-notmuch--tree-buffer
(let ((mb (current-buffer)))
@@ -293,13 +287,29 @@
(outline-show-entry)
(when and-show (notmuch-tree-show-message nil)))
+(defsubst jao-notmuch-tree--message-open ()
+ (and (buffer-live-p notmuch-tree-message-buffer)
+ (get-buffer-window notmuch-tree-message-buffer)))
+
+(defsubst jao-notmuch--get-prop (prop &optional props)
+ (or (and props (plist-get props prop))
+ (notmuch-tree-get-prop prop)
+ (notmuch-show-get-prop prop)))
+
+(defun jao-notmuch--looking-at-match-p ()
+ (and (jao-notmuch--get-prop :match)
+ (equal (jao-notmuch--get-prop :orig-tags)
+ (jao-notmuch--get-prop :tags))))
+
(defun jao-notmuch-tree--next (prev thread no-exit &optional ignore-new)
(let ((line-move-ignore-invisible nil))
- (cond ((and (not ignore-new) (jao-notmuch--looking-at-new-p)))
+ (cond ((and (not ignore-new)
+ (jao-notmuch--looking-at-match-p)
+ (not (jao-notmuch-tree--message-open))))
(thread
(notmuch-tree-next-thread prev)
(unless (or (not (notmuch-tree-get-message-properties))
- (jao-notmuch--looking-at-new-p))
+ (jao-notmuch--looking-at-match-p))
(notmuch-tree-matching-message prev (not no-exit))))
(t (notmuch-tree-matching-message prev (not no-exit)))))
(when (notmuch-tree-get-message-id)