From 852a91dd73b554832bf6623e2156532da1220f29 Mon Sep 17 00:00:00 2001 From: jao Date: Sun, 4 Sep 2022 03:31:30 +0100 Subject: jao-notmuch: using notmuch-tree-process-exit-functions --- lib/net/jao-notmuch.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib/net') 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 -- cgit v1.2.3