Reply inline in notmuch-show buffer, "mu4e-conversation style"
mail at ambrevar.xyz
Tue Mar 19 07:03:21 PDT 2019
What I did in mu4e-conversation was actually rather simple, albeit a bit
- Copy the test from the composition buffer
- Save the window excursion
- Fire up a new message buffer as notmuch-show-reply would produce.
- Cleanup the citation.
- Insert the copied text from the composition buffer.
Sadly, mu4e wraps too much around message-mode and this forced me to use
some ugly hacks. I haven't looked at notmuch's code yet, but it seems
that it does not wrap quite as much, so it might be cleaner and as
simple as a writing a 10-line-longish function.
The "hardest" part is to add a composition area.
Here is the code excerpt from mu4e-conversation:
(defun mu4e-conversation-send (&optional msg)
"Send message at the end of the view buffer.
If MSG is specified, then send this message instead.
Most `mu4e-compose-…' variables are lexically bound during the
call of this function."
(mu4e-warn "(send) Not a conversation buffer"))
;; [More local variables...]
;; Force-kill DRAFT-BUF on succcess since it's an implementation
;; detail in mu4e-conversation and the composition area is in BUF.
(let ((message-kill-buffer-on-exit t))
;; Stay in draft buffer and widen in case we failed during header check.
(error (setq draft-buf (current-buffer))
;; Delete message that was just sent.
(delete-region (line-beginning-position 1) (point-max))
;; Ensure it's writable.
;; -after-send-hook can be used to update the conversation buffer so that
;; it includes the message that was just sent.
The hackish part is in mu4e-conversation--open-draft, which I'm not
including here because it's long and boring. Hopefully notmuch.el won't
require us to do this.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 487 bytes
Desc: not available
More information about the notmuch