summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-04 03:31:30 +0100
committerjao <jao@gnu.org>2022-09-04 03:31:30 +0100
commit852a91dd73b554832bf6623e2156532da1220f29 (patch)
tree5d9a81cd2c91532ae1448e02398134ed2cb97d82
parent819d5e2da42d8eefdb6b5f2bdf348fb9e71e1dd4 (diff)
downloadelibs-852a91dd73b554832bf6623e2156532da1220f29.tar.gz
elibs-852a91dd73b554832bf6623e2156532da1220f29.tar.bz2
jao-notmuch: using notmuch-tree-process-exit-functions
-rw-r--r--lib/net/jao-notmuch.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el
index 0d5ff53..d7e27b6 100644
--- a/lib/net/jao-notmuch.el
+++ b/lib/net/jao-notmuch.el
@@ -354,18 +354,21 @@
(interactive "P")
(jao-notmuch-tree--next t t exit))
+;;; tree setup overall function
-;;; Updating the tree window after insertion
-
-(defun jao-notmuch--tree-sentinel (proc &rest _)
+(defun jao-notmuch-tree--sentinel (proc)
(when (eq (process-status proc) 'exit)
+ (let ((inhibit-read-only t))
+ (save-excursion
+ (goto-char (point-max))
+ (when (re-search-backward "^End of search results." nil t)
+ (let ((kill-whole-line t)) (kill-line)))))
(jao-notmuch-tree-hide-others)))
(defun jao-notmuch-tree-setup (&optional prefix)
"Set up display of trees, with PREFIX key for outline commands."
- (jao-notmuch-tree-outline-setup prefix)
- (advice-add 'notmuch-tree-process-sentinel :after #'jao-notmuch--tree-sentinel))
-
+ (add-hook 'notmuch-tree-process-exit-functions #'jao-notmuch-tree--sentinel)
+ (jao-notmuch-tree-outline-setup prefix))
;;; tagging