2

I noticed that Wanderlust 2.15.9 (Almost Unreal) does not automatically mark an email as "answered" to which I have written a reply, as some other mail clients do. How can I make it do so? I am aware that there are wl-summary-mark-as-answered and the likes, but I am not sure how to use them from a elisp code.

Pteromys
  • 185
  • 5
  • I use `wl-summary-reply-with-citation` and mine gets marked as "`a`" with the whole line is `wl-highlight-summary-answered-face`, but I don't know if I previously fixed it to mark the email as answered (it has been several years already). What function are you using to answer? I'm happy to trace, but would like to make sure I'm starting with the right function. – lawlist Dec 09 '16 at 22:38
  • @lawlist Thank you for your attention! I use `mime-preview-follow-current-entity` in an MIME-View-mode buffer, since oftentimes I want to cite only the text/plain part of the email. And you are right, if I use your function the message gets marked as answered. – Pteromys Dec 10 '16 at 01:09
  • Rather than getting fancy with advice, I would probably just create a new function: `(defun foo () (interactive) (wl-summary-mark-as-answered) (mime-preview-follow-currentity))` I looked at the function you are calling and I didn't see any hooks that were obvious. – lawlist Dec 10 '16 at 06:33
  • @lawlist Thank you for your help. Ideally, I'd like to mark the message as answered only after sending the reply, since I often start writing a reply without completing it... – Pteromys Dec 10 '16 at 19:51
  • What function do you use to send the email after replying with `mime-preview-follow-current-entity`? – lawlist Dec 10 '16 at 20:42
  • @lawlist `wl-draft-send-and-exit` – Pteromys Dec 10 '16 at 20:49

1 Answers1

2

The following answer is based on a bare-bones default configuration, with the following three steps:

  1. From the Summary buffer, select a message with the space bar (aka wl-summary-read).

  2. From the " *WL:Message*" buffer, type M-x mime-preview-follow-current-entity.

  3. From the "+draft/1" buffer, press C-c C-c (aka wl-draft-send-and-exit).

CAVEAT:  The default value for mime-preview-following-method-alist is ((wl-original-message-mode . wl-message-follow-current-entity)).

(require 'wl)

(defun wl-message-follow-current-entity (buffer)
  "Follow to current message.  @lawlist redefined this function so that
`wl-draft-reply' uses the optional argument of NUMBER.  NUMBER will become
`wl-draft-parent-number' by virtue of `wl-draft-create-buffer'."
  (wl-draft-reply  ;; reply to all
    (wl-message-get-original-buffer)
    nil
    wl-message-buffer-cur-summary-buffer
    wl-message-buffer-cur-number)
  (let ((mail-reply-buffer buffer))
    (wl-draft-yank-from-mail-reply-buffer nil)))
lawlist
  • 18,826
  • 5
  • 37
  • 118
  • I put your code in my `.wl`, but it didn't mark the message as answered. Perhaps this has to do with lexical/dynamic binding? (My Emacs version is 24.4.1.) – Pteromys Dec 12 '16 at 20:37
  • In the comments underneath the original question, you indicated that the buffer is in `mime-view-mode`. The default configuration when following steps 1, 2 and 3 above will result in a `wl-draft-mode` buffer. So, we need to backtrack to see what actual steps are you taking beginning from the Summary buffer to end up with a `mime-view-mode` buffer after launching `M-x mime-preview-follow-current-entity`. We should also check the value of `mime-preview-following-method-alist` to see whether you have modified the default setting `((wl-original-message-mode . wl-message-follow-current-entity))` – lawlist Dec 12 '16 at 23:25
  • As it turns out, your code works now. I believe what I was experiencing was due to some inconsistency in defuns or lack of synchronization between Wanderlust and the IMAP server. Thank you! – Pteromys Dec 13 '16 at 00:48
  • 1
    I was able to simply everything down to just adding an optional argument to `wl-draft-reply` within `wl-message-follow-current-entity`. The previous fix to `wl-draft-send` relating to using the `mail-send-actions` is a bonafide fix, but is not needed for this answer. – lawlist Dec 18 '16 at 22:06