summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-09-07 14:50:54 +0100
committerjao <jao@gnu.org>2021-09-07 14:50:54 +0100
commit807e7bbdff9bbe160b9f716c821ab13328a9f083 (patch)
tree65d3592f67baf3165c808e4e4fa6170a9f3fe63e
parent7babc823092f8d6dcf45f147b3457c5f770af527 (diff)
downloadelibs-807e7bbdff9bbe160b9f716c821ab13328a9f083.tar.gz
elibs-807e7bbdff9bbe160b9f716c821ab13328a9f083.tar.bz2
notmuch little things
-rw-r--r--lib/net/jao-notmuch.el15
-rw-r--r--notmuch.org37
2 files changed, 32 insertions, 20 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index 2b5656a..6039238 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -69,15 +69,15 @@
"Scroll or next message in forest or exit if none."
(interactive)
(if (notmuch-tree-scroll-message-window)
- (notmuch-tree-next-matching-message t)
+ (jao-notmuch-tree-next nil)
(when (not (window-live-p notmuch-tree-message-window))
(notmuch-tree-show-message nil)))
(jao-notmuch--tree-update-buffer-name))
-(defun jao-notmuch-tree-show-or-scroll ()
+(defun jao-notmuch-tree-show-or-scroll (force)
"Show current message, or scroll it if visible."
- (interactive)
- (if (window-live-p notmuch-tree-message-window)
+ (interactive "P")
+ (if (and (not force) (window-live-p notmuch-tree-message-window))
(scroll-other-window 1)
(notmuch-tree-show-message nil)
(jao-notmuch--tree-update-buffer-name)))
@@ -290,9 +290,10 @@
(let ((line-move-ignore-invisible nil))
(cond ((jao-notmuch--looking-at-new-p))
(thread
- (when (notmuch-tree-next-thread prev)
- (unless (jao-notmuch--looking-at-new-p)
- (notmuch-tree-matching-message prev (not no-exit)))))
+ (notmuch-tree-next-thread prev)
+ (unless (or (not (notmuch-tree-get-message-properties))
+ (jao-notmuch--looking-at-new-p))
+ (notmuch-tree-matching-message prev (not no-exit))))
(t (notmuch-tree-matching-message prev (not no-exit)))))
(when (notmuch-tree-get-message-id)
(jao-notmuch-tree-hide-others t))
diff --git a/notmuch.org b/notmuch.org
index 98528e6..0ca72f5 100644
--- a/notmuch.org
+++ b/notmuch.org
@@ -155,7 +155,8 @@
:bind (:map notmuch-common-keymap
(("E" . jao-notmuch-open-enclosure)
- ("B" . jao-notmuch-browse-urls))
+ ("B" . notmuch-show-resend-message)
+ ("b" . jao-notmuch-browse-urls))
:filter (eq 'notmuch jao-afio-mail-function)
:map message-mode-map
(("C-c C-d" . notmuch-draft-postpone))))
@@ -241,15 +242,16 @@
"The Conversation – Articles (UK): ")))
(defun jao-mail-clean-address (fun address)
- (let ((address
- (if (string-match ".+ updates on arXiv.org: \\(.+\\)" address)
- (with-temp-buffer
- (insert (match-string 1 address))
- (let ((shr-width 1000))
- (shr-render-region (point-min) (point-max)))
- (replace-regexp-in-string "\"" "" (buffer-string)))
- (replace-regexp-in-string jao-mail-clean-rx "" address))))
- (funcall fun address)))
+ (when address
+ (let ((address
+ (if (string-match ".+ updates on arXiv.org: \\(.+\\)" address)
+ (with-temp-buffer
+ (insert (match-string 1 address))
+ (let ((shr-width 1000))
+ (shr-render-region (point-min) (point-max)))
+ (replace-regexp-in-string "\"" "" (buffer-string)))
+ (replace-regexp-in-string jao-mail-clean-rx "" address))))
+ (funcall fun address))))
(defun jao-notmuch-show-setup () (setq header-line-format nil))
@@ -285,7 +287,7 @@
'(("date" . "%12s ")
("count" . "%-7s ")
("authors" . "%-35s")
- ("subject" . "%-100s")
+ ("subject" . " %-100s")
("tags" . "(%s)")))
:bind (:map notmuch-search-mode-map
(("RET" . notmuch-tree-from-search-thread)
@@ -319,7 +321,13 @@
(jao-notmuch--msg-ticks)
(jao-notmuch--tree-subject)
("tags" . " (%s)"))
- notmuch-unthreaded-result-format notmuch-tree-result-format
+ notmuch-unthreaded-result-format notmuch-search-result-format
+ consult-notmuch-result-format
+ '((jao-notmuch--msg-ticks)
+ ("date" . "%12s ")
+ ("authors" . "%-35s")
+ ("subject" . " %-100s")
+ ("tags" . " (%s)"))
notmuch-tree-thread-symbols
'((prefix . "─") (top . "─") (top-tee . "┬")
(vertical . "│") (vertical-tee . "├") (bottom . "╰")
@@ -335,7 +343,8 @@
(jao-notmuch-tree-setup "T")
:bind (:map notmuch-tree-mode-map
- (("C" . jao-notmuch-echo-count)
+ (("b" . jao-notmuch-browse-urls)
+ ("C" . jao-notmuch-echo-count)
("d" . jao-notmuch-tree-delete-message)
("D" . jao-notmuch-tree-delete-thread)
("h" . jao-notmuch-goto-message-buffer)
@@ -349,6 +358,8 @@
("o" . jao-notmuch-tree-widen-search)
("p" . jao-notmuch-tree-previous)
("P" . jao-notmuch-tree-previous-thread)
+ ("r" . notmuch-tree-reply)
+ ("R" . notmuch-tree-reply-sender)
("s" . jao-notmuch-tree-spam)
("u" . jao-notmuch-tree-flag)
("v" . notmuch-tree-scroll-message-window)