+2006-04-21 Bill Wohler <wohler@newt.com>
+
+ * 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 <wohler@newt.com>
* mh-tool-bar.el (image-load-path): Define to shush compiler.
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)