* wl-draft.el (wl-draft-reply-position): New function.
[elisp/wanderlust.git] / wl / wl-draft.el
index 3d16f70..adeb247 100644 (file)
@@ -476,13 +476,23 @@ Reply to author if WITH-ARG is non-nil."
                    (cons 'Mail-Followup-To mail-followup-to))
              nil nil nil nil parent-folder)
     (setq wl-draft-reply-buffer buf)
-    (run-hooks 'wl-reply-hook)
-    (or (and to
-            (progn (mail-position-on-field "To")
-                   (wl-draft-beginning-of-line)))
-       (and newsgroups
-            (progn (mail-position-on-field "Newsgroups")
-                   (wl-draft-beginning-of-line))))))
+    (run-hooks 'wl-reply-hook)))
+
+(defun wl-draft-reply-position (position)
+  (cond ((eq position 'body)
+        (wl-draft-body-goto-top))
+       ((eq position 'bottom)
+        (wl-draft-body-goto-bottom))
+       ((eq position 'top)
+        (goto-char (point-min)))
+       ((and (stringp position)
+             (std11-field-body position))
+        (progn (mail-position-on-field position)
+               (wl-draft-beginning-of-line)))
+       ((listp position)
+        (while (car position)
+          (wl-draft-reply-position (car position))
+          (setq position (cdr position))))))
 
 (defun wl-draft-add-references ()
   (wl-draft-add-in-reply-to "References"))