From 4c5f0e481bb77deca7a7444e9f633239341399d4 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 9 May 2000 08:40:48 +0000 Subject: [PATCH] (wl-summary-reply): Return t if there was a message at cursor point. Added unwind-protect. (wl-summary-reply-with-citation): Cite only when wl-summary-reply returns t. --- wl/wl-summary.el | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 716d117..3686bba 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -4,7 +4,7 @@ ;; Author: Yuuichi Teranishi ;; Keywords: mail, net news -;; Time-stamp: <2000-05-09 17:20:12 teranisi> +;; Time-stamp: <2000-05-09 17:36:35 teranisi> ;; This file is part of Wanderlust (Yet Another Message Interface on Emacsen). @@ -4822,12 +4822,10 @@ If optional argument NUMBER is specified, mark message specified by NUMBER." (defun wl-summary-reply-with-citation (&optional arg) (interactive "P") - ;; Is unwind-protect needed? - ;(unwind-protect - (wl-summary-reply arg t) - (goto-char (point-max)) - (wl-draft-yank-original) - (run-hooks 'wl-mail-setup-hook));) + (when (wl-summary-reply arg t) + (goto-char (point-max)) + (wl-draft-yank-original) + (run-hooks 'wl-mail-setup-hook))) (defun wl-summary-jump-to-msg-by-message-id (&optional id) (interactive) @@ -4991,18 +4989,22 @@ Reply to author if invoked with argument." (number (wl-summary-message-number)) (summary-buf (current-buffer)) mes-buf) - (unless number (error "No message")) - (wl-summary-redisplay-internal folder number) - (wl-select-buffer (get-buffer (setq mes-buf (wl-current-message-buffer)))) - (set-buffer mes-buf) - (goto-char (point-min)) - (or wl-draft-use-frame - (split-window-vertically)) - (other-window 1) - (when (setq mes-buf (wl-message-get-original-buffer)) - (wl-draft-reply mes-buf (not arg) summary-buf) - (unless without-setup-hook - (run-hooks 'wl-mail-setup-hook))))) + (if number + (unwind-protect + (progn + (wl-summary-redisplay-internal folder number) + (wl-select-buffer + (get-buffer (setq mes-buf (wl-current-message-buffer)))) + (set-buffer mes-buf) + (goto-char (point-min)) + (or wl-draft-use-frame + (split-window-vertically)) + (other-window 1) + (when (setq mes-buf (wl-message-get-original-buffer)) + (wl-draft-reply mes-buf (not arg) summary-buf) + (unless without-setup-hook + (run-hooks 'wl-mail-setup-hook)))) + t)))) (defun wl-summary-write () "Write a new draft from Summary." -- 1.7.10.4