Mercurial > emacs
diff lisp/mh-e/mh-letter.el @ 70169:10be49d855c4
(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.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Fri, 21 Apr 2006 17:49:02 +0000 |
parents | 00cb3fe5fed5 |
children | da7bc97733d6 |
line wrap: on
line diff
--- a/lisp/mh-e/mh-letter.el Fri Apr 21 14:07:05 2006 +0000 +++ b/lisp/mh-e/mh-letter.el Fri Apr 21 17:49:02 2006 +0000 @@ -393,24 +393,26 @@ 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)