mu
mu copied to clipboard
[mu bug] avoid `find-file`
mu4e-compose-edit calls find-file which will display the buffer. I think find-file-noselect should be called instead. The former displays the buffer, the latter does not. At the point it is called, there does not appear to be a good way to decide on how to display the buffer.
I'm using
(mu4e--compose-setup
'edit
(lambda (parent)
- (find-file (plist-get parent :path))
+ (let ((buf (find-file-noselect (plist-get parent :path))))
+ (with-current-buffer buf
+ (mu4e-compose-mode)
+ (display-buffer buf)))
but I'm not sure this is a great "fix".
FWIW, I still have to patch this one to
(defun mu4e-compose-edit()
"Edit an existing draft message."
(interactive)
(let* ((msg (mu4e-message-at-point)))
(unless (member 'draft (mu4e-message-field msg :flags))
(mu4e-warn "Cannot edit non-draft messages"))
(mu4e--compose-setup
'edit
(lambda (parent)
(let ((buf (find-file-noselect (plist-get parent :path))))
(with-current-buffer buf
(mu4e--delimit-headers)
(mu4e-compose-mode))
(display-buffer buf))))))
- Based on this calling
switch-to-bufferin code is "against the rules" and indeed garbles up my window managment. - I need to add
(mu4e-compose-mode)to trigger mydisplay-buffer-alistlogic.
Let me stress once more that this is somewhat a "me" problem, i.e. I know I'm trying to bend mu4e to my will in a way you don't plan for.