* wl-draft.el (wl-draft-reply-position): New function.
authorokada <okada>
Sun, 22 Dec 2002 10:55:41 +0000 (10:55 +0000)
committerokada <okada>
Sun, 22 Dec 2002 10:55:41 +0000 (10:55 +0000)
        (wl-draft-reply-position): Fix.
        * wl-summary.el (wl-summary-reply): Use `wl-draft-reply-position'.
        (wl-summary-target-mark-reply-with-citation): Ditto.
        (wl-summary-reply-with-citation): Ditto.
        * wl-vars.el (wl-draft-reply-default-position): New variable.

wl/ChangeLog
wl/wl-draft.el
wl/wl-summary.el
wl/wl-vars.el

index edc4617..4669e70 100644 (file)
@@ -1,5 +1,14 @@
 2002-12-22  Kenichi OKADA  <okada@opaopa.org>
 
+       * wl-draft.el (wl-draft-reply-position): New function.
+       (wl-draft-reply-position): Fix.
+       * wl-summary.el (wl-summary-reply): Use `wl-draft-reply-position'.
+       (wl-summary-target-mark-reply-with-citation): Ditto.
+       (wl-summary-reply-with-citation): Ditto.
+       * wl-vars.el (wl-draft-reply-default-position): New variable.
+
+2002-12-22  Kenichi OKADA  <okada@opaopa.org>
+
        * wl-draft.el (wl-draft-send): Preview when interactive send.
 
 2002-12-22  Kenichi OKADA  <okada@opaopa.org>
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"))
index 7f0b615..c2a4d7f 100644 (file)
@@ -4695,33 +4695,33 @@ Return t if message exists."
        draft-buf)
     (wl-summary-jump-to-msg (car mlist))
     (wl-summary-reply arg t)
-    (save-excursion
-      (goto-char (point-max))
-      (setq start-point (point-marker))
-      (setq draft-buf (current-buffer))
-      (save-window-excursion
-       (while mlist
-         (set-buffer summary-buf)
-         (delete-other-windows)
-         (wl-summary-jump-to-msg (car mlist))
-         (wl-summary-redisplay)
-         (set-buffer draft-buf)
-         (goto-char (point-max))
-         (wl-draft-yank-original)
-         (setq mlist (cdr mlist)))
-       (goto-char start-point)
-       (save-excursion
-         (set-buffer summary-buf)
-         (wl-summary-delete-all-temp-marks)))
-      (run-hooks 'wl-mail-setup-hook))))
+    (goto-char (point-max))
+    (setq start-point (point-marker))
+    (setq draft-buf (current-buffer))
+    (save-window-excursion
+      (while mlist
+       (set-buffer summary-buf)
+       (delete-other-windows)
+       (wl-summary-jump-to-msg (car mlist))
+       (wl-summary-redisplay)
+       (set-buffer draft-buf)
+       (goto-char (point-max))
+       (wl-draft-yank-original)
+       (setq mlist (cdr mlist)))
+      (goto-char start-point)
+      (save-excursion
+       (set-buffer summary-buf)
+       (wl-summary-delete-all-temp-marks)))
+    (wl-draft-reply-position wl-draft-reply-default-position)
+    (run-hooks 'wl-mail-setup-hook)))
 
 (defun wl-summary-reply-with-citation (&optional arg)
   (interactive "P")
   (when (wl-summary-reply arg t)
-    (save-excursion
-      (goto-char (point-max))
-      (wl-draft-yank-original)
-      (run-hooks 'wl-mail-setup-hook))))
+    (goto-char (point-max))
+    (wl-draft-yank-original)
+    (wl-draft-reply-position wl-draft-reply-default-position)
+    (run-hooks 'wl-mail-setup-hook)))
 
 (defun wl-summary-jump-to-msg-by-message-id (&optional id)
   (interactive)
@@ -4925,9 +4925,9 @@ Reply to author if invoked with ARG."
       (goto-char (point-min))
       (when (setq mes-buf (wl-message-get-original-buffer))
        (wl-draft-reply mes-buf arg summary-buf)
+       (wl-draft-reply-position wl-draft-reply-default-position)
        (unless without-setup-hook
-         (save-excursion
-           (run-hooks 'wl-mail-setup-hook))))
+         (run-hooks 'wl-mail-setup-hook)))
       t)))
 
 (defun wl-summary-write ()
index 21531a2..72c4f5d 100644 (file)
@@ -1263,6 +1263,29 @@ If it is a function, it is called with the draft buffer as an argument."
                 (sexp :tag "Use Function"))
   :group 'wl-draft)
 
+(defcustom wl-draft-reply-default-position 'body
+  "Begining position of reply buffer.
+'body means the top of body.
+'bottom means the bottom of body.
+'top means the top of header.
+\"To\", \"Newsgroups\", \"Subject\" means the position of the header field.
+You can also set it to a list of setting.
+"
+  :type '(choice (repeat
+                 (choice
+                  (const :tag "Top of body" body)
+                  (const :tag "Bottom of body" bottom)
+                  (const :tag "Top of header" top)
+                  (const "To")
+                  (const "Newsgroups")
+                  (const "Subject")
+                  (string :tag "Header Name")))
+                (const "To")
+                (const "Newsgroups")
+                (const "Subject")
+                (string :tag "Header Name"))
+  :group 'wl-draft)
+
 (defcustom wl-draft-queue-save-variables
   '(wl-envelope-from wl-from
     wl-smtp-posting-server wl-smtp-posting-user wl-smtp-posting-port