Commit c2134792 authored by Bill Wohler's avatar Bill Wohler
Browse files

* mh-comp.el (mh-insert-letter): If you choose a different folder, the

cur message is used (closes SF #1205890).

* mh-mime.el (mh-compose-forward): Use standard range argument instead
of messages. Use more powerful mh-read-range instead of read-string.
Sync docstring with manual (close SF #1205890).
parent 7dafe00b
2006-01-10 Bill Wohler <wohler@newt.com> 2006-01-10 Bill Wohler <wohler@newt.com>
* mh-comp.el (mh-insert-letter): If you choose a different folder,
the cur message is used (closes SF #1205890).
* mh-mime.el (mh-compose-forward): Use standard range argument
instead of messages. Use more powerful mh-read-range instead of
read-string. Sync docstring with manual (close SF #1205890).
* mh-index.el (mh-index-search): Checking mh-find-path-run is * mh-index.el (mh-index-search): Checking mh-find-path-run is
unnecessary. unnecessary.
(mh-index-next-folder): Don't back up a line when going backwards (mh-index-next-folder): Don't back up a line when going backwards
......
...@@ -1514,23 +1514,33 @@ use `mh-send-prog' to tell MH-E the name." ...@@ -1514,23 +1514,33 @@ use `mh-send-prog' to tell MH-E the name."
(defun mh-insert-letter (folder message verbatim) (defun mh-insert-letter (folder message verbatim)
"Insert a message. "Insert a message.
This command prompts you for the FOLDER and MESSAGE number and inserts This command prompts you for the FOLDER and MESSAGE number, which
defaults to the current message in that folder. It then inserts
the message, indented by `mh-ins-buf-prefix' (\"> \") unless the message, indented by `mh-ins-buf-prefix' (\"> \") unless
`mh-yank-behavior' is set to one of the supercite flavors in which `mh-yank-behavior' is set to one of the supercite flavors in
case supercite is used to format the message. Certain undesirable which case supercite is used to format the message. Certain
header fields (see `mh-invisible-header-fields-compiled') are removed undesirable header fields (see
before insertion. `mh-invisible-header-fields-compiled') are removed before
insertion.
If given a prefix argument VERBATIM, the header is left intact, the If given a prefix argument VERBATIM, the header is left intact, the
message is not indented, and \"> \" is not inserted before each line. message is not indented, and \"> \" is not inserted before each line.
This command leaves the mark before the letter and point after it." This command leaves the mark before the letter and point after it."
(interactive (interactive
(list (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) (let* ((folder
(read-string (concat "Message number" (mh-prompt-for-folder "Message from"
(if (numberp mh-sent-from-msg) mh-sent-from-folder nil))
(format " (default %d): " mh-sent-from-msg) (default
": "))) (if (and (equal folder mh-sent-from-folder)
current-prefix-arg)) (numberp mh-sent-from-msg))
mh-sent-from-msg
(nth 0 (mh-translate-range folder "cur"))))
(message
(read-string (concat "Message number"
(or (and default
(format " (default %d): " default))
": ")))))
(list folder message current-prefix-arg)))
(save-restriction (save-restriction
(narrow-to-region (point) (point)) (narrow-to-region (point) (point))
(let ((start (point-min))) (let ((start (point-min)))
......
...@@ -73,41 +73,36 @@ attachment." ...@@ -73,41 +73,36 @@ attachment."
(call-interactively 'mh-mh-attach-file))) (call-interactively 'mh-mh-attach-file)))
;;;###mh-autoload ;;;###mh-autoload
(defun mh-compose-forward (&optional description folder messages) (defun mh-compose-forward (&optional description folder range)
"Add tag to forward a message. "Add tag to forward a message.
You are prompted for a content DESCRIPTION, the name of the You are prompted for a content DESCRIPTION, the name of the
FOLDER in which the messages to forward are located, and the FOLDER in which the messages to forward are located, and a RANGE
MESSAGES' numbers. of messages, which defaults to the current message in that
folder. Check the documentation of `mh-interactive-range' to see
how RANGE is read in interactive use.
The option `mh-compose-insertion' controls what type of tags are inserted." The option `mh-compose-insertion' controls what type of tags are inserted."
(interactive (let* (interactive
((description (mml-minibuffer-read-description)) (let* ((description
(folder (mh-prompt-for-folder "Message from" (mml-minibuffer-read-description))
mh-sent-from-folder nil)) (folder
(messages (let ((default-message (mh-prompt-for-folder "Message from"
(if (and (equal mh-sent-from-folder nil))
folder mh-sent-from-folder) (default
(numberp mh-sent-from-msg)) (if (and (equal folder mh-sent-from-folder)
mh-sent-from-msg (numberp mh-sent-from-msg))
(nth 0 (mh-translate-range mh-sent-from-msg
folder "cur"))))) (nth 0 (mh-translate-range folder "cur"))))
(if default-message (range
(read-string (mh-read-range "Forward" folder
(format "Messages (default %d): " (or (and default
default-message) (number-to-string default))
nil nil t)
(number-to-string default-message)) t t)))
(read-string (format "Messages: ")))))) (list description folder range)))
(list description folder messages))) (let ((messages (mapconcat 'identity (mh-list-to-string range) " ")))
(let (dolist (message (mh-translate-range folder messages))
((range))
(if (null messages)
(setq messages ""))
(setq range (mh-translate-range folder messages))
(if (null range)
(error "No messages in specified range"))
(dolist (message range)
(if (equal mh-compose-insertion 'mml) (if (equal mh-compose-insertion 'mml)
(mh-mml-forward-message description folder (format "%s" message)) (mh-mml-forward-message description folder (format "%s" message))
(mh-mh-forward-message description folder (format "%s" message)))))) (mh-mh-forward-message description folder (format "%s" message))))))
...@@ -134,7 +129,7 @@ given a prefix argument. Normally default arguments to ...@@ -134,7 +129,7 @@ given a prefix argument. Normally default arguments to
"Regexp matching valid media types used in MIME attachment compositions.") "Regexp matching valid media types used in MIME attachment compositions.")
(defvar mh-have-file-command 'undefined (defvar mh-have-file-command 'undefined
"Cached value of `mh-have-file-command'. "Cached value of function `mh-have-file-command'.
Do not reference this variable directly as it might not have been Do not reference this variable directly as it might not have been
initialized. Always use the command `mh-have-file-command'.") initialized. Always use the command `mh-have-file-command'.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment