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.
This commit is contained in:
Henrik Lissner 2021-09-30 01:26:25 +02:00
parent db51c6be88
commit d29a2fd865

View file

@ -39,6 +39,17 @@ OR a shell command string such as
'notmuch-company '(company-ispell company-yasnippet)) 'notmuch-company '(company-ispell company-yasnippet))
(set-popup-rule! "^\\*notmuch-hello" :side 'left :size 30 :ttl 0) (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 (setq notmuch-fcc-dirs nil
message-kill-buffer-on-exit t message-kill-buffer-on-exit t