Check for detached view in the navigation context macro

This commit is contained in:
Mickey Petersen 2022-11-30 15:33:07 +00:00
parent 8d2b75219f
commit d6c67a401d
2 changed files with 6 additions and 2 deletions

View File

@ -156,7 +156,10 @@ Then, display the results."
;; are we already inside a headers buffer?
((mu4e-current-buffer-type-p 'headers) (current-buffer))
;; if not, are we inside a view buffer, and does it have linked headers buffer?
((mu4e-current-buffer-type-p 'view) (mu4e-get-headers-buffer))
((mu4e-current-buffer-type-p 'view)
(when (mu4e--view-detached-p (current-buffer))
(mu4e-error "You cannot navigate in a detached view buffer."))
(mu4e-get-headers-buffer))
;; fallback; but what would trigger this?
(t (mu4e-get-headers-buffer))))
(docid (mu4e-message-field msg :docid)))

View File

@ -80,7 +80,8 @@ generated name does not already exist."
;; detached -- raise an error.
(and (mu4e-current-buffer-type-p 'view)
(or mu4e-linked-headers-buffer
(error "This view buffer is detached")))
;; (error "This view buffer is detached")
))
;; if we're already in a headers buffer then
;; that is the one we use.
(and (mu4e-current-buffer-type-p 'headers)