+2002-11-07 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * wl-summary.el (wl-summary-reply): Don't treat switch buffer here.
+ (wl-summary-forward): Ditto.
+
+ * wl-vars.el (wl-draft-buffer-style): Added choice of keep and
+ function.
+ (wl-draft-buffer-style): New use option.
+
+ * wl-draft.el (wl-draft-create-buffer): Abolish argument `full'.
+ (wl-draft): Follow the change above.
+ (wl-draft-create-buffer): Use wl-draft-reply-buffer-style and
+ wl-draft-buffer-style.
+ (wl-user-agent-compose): Bind wl-draft-buffer-style with
+ switch-function.
+
2002-11-01 Tomotaka SUWA <cooper@saitama.fujimic.fujisankei-g.co.jp>
* wl-address.el (wl-address-make-completion-entry): Extracted from
(let (buf-name header-alist-internal)
(setq buf-name
- (wl-draft-create-buffer
- (or
- (eq this-command 'wl-draft)
- (eq this-command 'wl-summary-write)
- (eq this-command 'wl-summary-write-current-folder)
- (eq this-command 'wl-folder-write-current-folder))
- parent-folder))
+ (wl-draft-create-buffer parent-folder))
(unless (cdr (assq 'From header-alist))
(setq header-alist
(goto-char (point-max))))
buf-name))
-(defun wl-draft-create-buffer (&optional full parent-folder)
+(defun wl-draft-create-buffer (&optional parent-folder)
(let* ((draft-folder (wl-folder-get-elmo-folder wl-draft-folder))
(parent-folder (or parent-folder (wl-summary-buffer-folder-name)))
(summary-buf (wl-summary-get-buffer parent-folder))
- buf-name file-name num change-major-mode-hook)
+ buf-name file-name num change-major-mode-hook
+ (reply-or-forward (or (eq this-command 'wl-summary-reply)
+ (eq this-command 'wl-summary-forward))))
(if (not (elmo-folder-message-file-p draft-folder))
(error "%s folder cannot be used for draft folder" wl-draft-folder))
(setq num (elmo-max-of-list
(elmo-message-file-name
(wl-folder-get-elmo-folder wl-draft-folder)
num))))
+ ;; switch-buffer according to draft buffer style.
(if wl-draft-use-frame
(switch-to-buffer-other-frame buf-name)
- (switch-to-buffer buf-name))
+ (if reply-or-forward
+ (case wl-draft-reply-buffer-style
+ (split
+ (split-window-vertically)
+ (other-window 1)
+ (switch-to-buffer buf-name))
+ (keep
+ (switch-to-buffer buf-name))
+ (full
+ (delete-other-windows)
+ (switch-to-buffer buf-name))
+ (t
+ (if (functionp wl-draft-reply-buffer-style)
+ (funcall wl-draft-reply-buffer-style buf-name)
+ (error "Invalid value for wl-draft-reply-buffer-style"))))
+ (case wl-draft-buffer-style
+ (split
+ (when (and (eq major-mode 'wl-summary-mode)
+ wl-message-buffer
+ (buffer-live-p wl-message-buffer)
+ (get-buffer-window wl-message-buffer))
+ (delete-window (get-buffer-window wl-message-buffer)))
+ (split-window-vertically)
+ (other-window 1)
+ (switch-to-buffer buf-name))
+ (keep
+ (switch-to-buffer buf-name))
+ (full
+ (delete-other-windows)
+ (switch-to-buffer buf-name))
+ (t (if (functionp wl-draft-buffer-style)
+ (funcall wl-draft-buffer-style buf-name)
+ (error "Invalid value for wl-draft-buffer-style"))))))
(set-buffer buf-name)
(if (not (string-match (regexp-quote wl-draft-folder)
(buffer-name)))
(rename-buffer (concat wl-draft-folder "/" (int-to-string num))))
- (if (or (eq wl-draft-reply-buffer-style 'full)
- full)
- (delete-other-windows))
(auto-save-mode -1)
(wl-draft-mode)
(make-local-variable 'truncate-partial-width-windows)
;; to be necessary to protect the values used w/in
(let ((wl-user-agent-headers-and-body-alist other-headers)
(wl-draft-use-frame (eq switch-function 'switch-to-buffer-other-frame))
- (wl-draft-reply-buffer-style 'split))
+ (wl-draft-buffer-style switch-function))
(when (eq switch-function 'switch-to-buffer-other-window)
(when (one-window-p t)
(if (window-minibuffer-p) (other-window 1))
(wl-message-select-buffer wl-message-buffer)
(set-buffer mes-buf)
(goto-char (point-min))
- (unless wl-draft-use-frame
- (split-window-vertically)
- (other-window 1))
(when (setq mes-buf (wl-message-get-original-buffer))
(wl-draft-reply mes-buf arg summary-buf)
(unless without-setup-hook
(wl-summary-redisplay-internal folder number))
(setq mes-buf wl-message-buffer)
(wl-message-select-buffer mes-buf)
- (unless wl-draft-use-frame
- (split-window-vertically)
- (other-window 1))
;; get original subject.
(if summary-buf
(save-excursion
:group 'wl-draft
:group 'wl-pref)
+(defcustom wl-draft-buffer-style 'full
+ "Style of draft buffer except for `wl-summary-reply' and `wl-summary-forward'
+'keep is to use current window, 'full is to use full frame window and
+'split is to split current window.
+If it is a function, it is called with the draft buffer as an argument."
+ :type '(choice (const :tag "Keep window" keep)
+ (const :tag "Split window" split)
+ (const :tag "Full window"full)
+ (sexp :tag "Use Function"))
+ :group 'wl-draft)
+
(defcustom wl-draft-reply-buffer-style 'split
- "'split or 'full."
- :type '(radio (const split)
- (const full))
+ "Style of draft buffer for `wl-summary-reply' and `wl-summary-forward'
+'keep is to use message buffer window, 'full is to use full frame window and
+'split is to split message buffer window.
+If it is a function, it is called with the draft buffer as an argument."
+ :type '(choice (const :tag "Keep window" keep)
+ (const :tag "Split window" split)
+ (const :tag "Full window"full)
+ (sexp :tag "Use Function"))
:group 'wl-draft)
(defcustom wl-draft-queue-save-variables