From 52f94fbf928b2362a71bac66ed47189106967f7d Mon Sep 17 00:00:00 2001 From: jao Date: Tue, 2 Apr 2024 23:05:31 +0100 Subject: notmuch: better restore for window configuration back from tree --- custom/jao-custom-notmuch.el | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/custom/jao-custom-notmuch.el b/custom/jao-custom-notmuch.el index 0cbbfaa..7683959 100644 --- a/custom/jao-custom-notmuch.el +++ b/custom/jao-custom-notmuch.el @@ -380,11 +380,8 @@ notmuch-wash-citation-lines-prefix 120 notmuch-wash-citation-lines-suffix 120 notmuch-show-text/html-blocked-images "." - jao-notmuch-header-line-format - (if jao-mode-line-in-minibuffer - "%Q [%N / %M / %T] %n / %m / %t" - "[%N / %M / %T] %n / %m / %t") - notmuch-show-header-line #'jao-notmuch-message-header-line) + notmuch-show-header-line nil ;; #'jao-notmuch-message-header-line + jao-notmuch-header-line-format "[%N / %M / %T] %n / %m / %t") :config @@ -483,17 +480,16 @@ (defun jao-notmuch-before-tree (&rest _args) (when (string= (buffer-name) "*notmuch-hello*") + (window-configuration-to-register ?G) (split-window-right 40) (other-window 1))) (defvar jao-notmuch--visits 0) (defun jao-notmuch-after-tree-quit (&optional _both) - (when (and (not (derived-mode-p 'notmuch-tree-mode 'notmuch-hello-mode)) - (save-window-excursion (other-window -1) - (derived-mode-p 'notmuch-hello-mode))) - (delete-window) - (jao-notmuch-refresh-hello (= 0 (mod (cl-incf jao-notmuch--visits) 100))))) + (when (not (derived-mode-p 'notmuch-tree-mode 'notmuch-hello-mode)) + (jump-to-register ?G)) + (jao-notmuch-refresh-hello (= 0 (mod (cl-incf jao-notmuch--visits) 50)))) (defun jao-notmuch-tree--sentinel (proc) (when (eq (process-status proc) 'exit) @@ -501,7 +497,8 @@ (save-excursion (goto-char (point-max)) (when (re-search-backward "^End of search results." nil t) - (delete-line)))))) + (delete-line)))) + (jao-notmuch-thread-info-mode))) (add-hook 'notmuch-tree-process-exit-functions #'jao-notmuch-tree--sentinel) -- cgit v1.2.3