From 15855f8f789cbe98f2df394904350bfaec71bd53 Mon Sep 17 00:00:00 2001 From: Bill Wohler Date: Fri, 21 Apr 2006 17:49:02 +0000 Subject: [PATCH] (mh-insert-letter): If a message number isn't given, throw an error rather than using a potentially incorrect message number (closes SF #1473729). In addition, use the cur message if mh-sent-from-msg is nil (when sending a message, in contrast to replying). Move conversion of int to string into interactive stanza so body can assume variables are of proper type. --- lisp/mh-e/ChangeLog | 10 ++++++++++ lisp/mh-e/mh-letter.el | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 89ca1dc04aa..0a7c11e00a5 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,13 @@ +2006-04-21 Bill Wohler + + * mh-letter.el (mh-insert-letter): If a message number isn't + given, throw an error rather than using a potentially incorrect + message number (closes SF #1473729). In addition, use the cur + message if mh-sent-from-msg is nil (when sending a message, in + contrast to replying). Move conversion of int to string into + interactive stanza so body can assume variables are of proper + type. + 2006-04-20 Bill Wohler * mh-tool-bar.el (image-load-path): Define to shush compiler. diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el index 9445b5ea41f..37cc8fcf31e 100644 --- a/lisp/mh-e/mh-letter.el +++ b/lisp/mh-e/mh-letter.el @@ -393,24 +393,26 @@ message is not indented, and \"> \" is not inserted before each line. This command leaves the mark before the letter and point after it." (interactive (let* ((folder - (mh-prompt-for-folder "Message from" - mh-sent-from-folder nil)) + (mh-prompt-for-folder "Message from" mh-sent-from-folder nil)) (default - (if (and (equal folder mh-sent-from-folder) - (numberp mh-sent-from-msg)) - mh-sent-from-msg + (if (equal folder mh-sent-from-folder) + (or mh-sent-from-msg (nth 0 (mh-translate-range folder "cur"))) (nth 0 (mh-translate-range folder "cur")))) (message (read-string (concat "Message number" (or (and default (format " (default %d): " default)) - ": "))))) + ": ")) + nil nil + (if (numberp default) + (int-to-string default) + default)))) (list folder message current-prefix-arg))) + (if (equal message "") + (error "No message number given")) (save-restriction (narrow-to-region (point) (point)) (let ((start (point-min))) - (if (and (equal message "") (numberp mh-sent-from-msg)) - (setq message (int-to-string mh-sent-from-msg))) (insert-file-contents (expand-file-name message (mh-expand-file-name folder))) (when (not verbatim) -- 2.39.2