From d29a2fd865f280e362e59bf45c93cbc3eb151066 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 30 Sep 2021 01:26:25 +0200 Subject: [PATCH] fix(notmuch): messages open in tiny popup We couldn't write a popup rule for message buffers because they were named *X*, where X was the email's subject line. There was no distinct pattern to target via regex, and the buffer is display before its mode is initialized, so a more sophisticated popup rule wouldn't work either. By renaming message buffers *subject:X*, we now have a chance to target it. --- modules/email/notmuch/config.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/email/notmuch/config.el b/modules/email/notmuch/config.el index 1979e37e2..fa179d287 100644 --- a/modules/email/notmuch/config.el +++ b/modules/email/notmuch/config.el @@ -39,6 +39,17 @@ OR a shell command string such as 'notmuch-company '(company-ispell company-yasnippet)) (set-popup-rule! "^\\*notmuch-hello" :side 'left :size 30 :ttl 0) + (set-popup-rule! "^\\*subject:" :size 0.6 :ttl 0) + + (defadvice! +notmuch-search-show-thread-a (fn &rest args) + "Give email buffers a sane name so they can be targeted via +`display-buffer-alist' (and the :ui popup module)." + :around #'notmuch-search-show-thread + (letf! (defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-context buffer-name) + (funcall notmuch-show + thread-id elide-toggle parent-buffer query-context + (format "*subject:%s*" (substring buffer-name 1 -1)))) + (apply fn args))) (setq notmuch-fcc-dirs nil message-kill-buffer-on-exit t