]> code.delx.au - gnu-emacs/commitdiff
* mh-comp.el (mh-insert-letter): If you choose a different folder, the
authorBill Wohler <wohler@newt.com>
Wed, 11 Jan 2006 07:46:57 +0000 (07:46 +0000)
committerBill Wohler <wohler@newt.com>
Wed, 11 Jan 2006 07:46:57 +0000 (07:46 +0000)
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).

lisp/mh-e/ChangeLog
lisp/mh-e/mh-comp.el
lisp/mh-e/mh-mime.el

index 981c60a462b5b7532ea1e8c05a99aba6533b8793..e5e62c0c3827f9b8343462355d25a81fdd096e69 100644 (file)
@@ -1,5 +1,12 @@
 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
        unnecessary.
        (mh-index-next-folder): Don't back up a line when going backwards
index c3ed1c1a8a272246047544e00156797ccea907c5..4011d811c2c530cfd883252f87a39fd11dda0509 100644 (file)
@@ -1514,23 +1514,33 @@ use `mh-send-prog' to tell MH-E the name."
 (defun mh-insert-letter (folder message verbatim)
   "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
-`mh-yank-behavior' is set to one of the supercite flavors in which
-case supercite is used to format the message. Certain undesirable
-header fields (see `mh-invisible-header-fields-compiled') are removed
-before insertion.
+`mh-yank-behavior' is set to one of the supercite flavors in
+which case supercite is used to format the message. Certain
+undesirable header fields (see
+`mh-invisible-header-fields-compiled') are removed before
+insertion.
 
 If given a prefix argument VERBATIM, the header is left intact, the
 message is not indented, and \"> \" is not inserted before each line.
 This command leaves the mark before the letter and point after it."
   (interactive
-   (list (mh-prompt-for-folder "Message from" mh-sent-from-folder nil)
-         (read-string (concat "Message number"
-                              (if (numberp mh-sent-from-msg)
-                                  (format " (default %d): " mh-sent-from-msg)
-                                ": ")))
-         current-prefix-arg))
+   (let* ((folder
+           (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
+              (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
     (narrow-to-region (point) (point))
     (let ((start (point-min)))
index ab67e9c6db0090a4e204415b0c83e046cae45eba..0932dab1e944d23c0798b831fbd0ef8a10007d8c 100644 (file)
@@ -73,41 +73,36 @@ attachment."
     (call-interactively 'mh-mh-attach-file)))
 
 ;;;###mh-autoload
-(defun mh-compose-forward (&optional description folder messages)
+(defun mh-compose-forward (&optional description folder range)
   "Add tag to forward a message.
 
 You are prompted for a content DESCRIPTION, the name of the
-FOLDER in which the messages to forward are located, and the
-MESSAGES' numbers.
+FOLDER in which the messages to forward are located, and a RANGE
+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."
-  (interactive (let*
-                   ((description (mml-minibuffer-read-description))
-                    (folder (mh-prompt-for-folder "Message from"
-                                                  mh-sent-from-folder nil))
-                    (messages (let ((default-message
-                                      (if (and (equal
-                                                folder mh-sent-from-folder)
-                                               (numberp mh-sent-from-msg))
-                                          mh-sent-from-msg
-                                        (nth 0 (mh-translate-range
-                                                folder "cur")))))
-                                (if default-message
-                                    (read-string
-                                     (format "Messages (default %d): "
-                                             default-message)
-                                     nil nil
-                                     (number-to-string default-message))
-                                  (read-string (format "Messages: "))))))
-                 (list description folder messages)))
-  (let
-      ((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)
+  (interactive
+   (let* ((description
+           (mml-minibuffer-read-description))
+          (folder
+           (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
+              (nth 0 (mh-translate-range folder "cur"))))
+          (range
+           (mh-read-range "Forward" folder
+                          (or (and default
+                                   (number-to-string default))
+                              t)
+                          t t)))
+     (list description folder range)))
+  (let ((messages (mapconcat 'identity (mh-list-to-string range) " ")))
+    (dolist (message (mh-translate-range folder messages))
       (if (equal mh-compose-insertion 'mml)
           (mh-mml-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
   "Regexp matching valid media types used in MIME attachment compositions.")
 
 (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
 initialized. Always use the command `mh-have-file-command'.")