Mercurial > emacs
comparison lisp/mh-e/mh-mime.el @ 68130:dfa5a760e24f
* 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).
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Wed, 11 Jan 2006 07:46:57 +0000 |
parents | b6c30efb3e37 |
children | 03bac2d0a4aa |
comparison
equal
deleted
inserted
replaced
68129:6f5da26b0df1 | 68130:dfa5a760e24f |
---|---|
71 (mh-mml-attach-file "inline") | 71 (mh-mml-attach-file "inline") |
72 (mh-mml-attach-file)) | 72 (mh-mml-attach-file)) |
73 (call-interactively 'mh-mh-attach-file))) | 73 (call-interactively 'mh-mh-attach-file))) |
74 | 74 |
75 ;;;###mh-autoload | 75 ;;;###mh-autoload |
76 (defun mh-compose-forward (&optional description folder messages) | 76 (defun mh-compose-forward (&optional description folder range) |
77 "Add tag to forward a message. | 77 "Add tag to forward a message. |
78 | 78 |
79 You are prompted for a content DESCRIPTION, the name of the | 79 You are prompted for a content DESCRIPTION, the name of the |
80 FOLDER in which the messages to forward are located, and the | 80 FOLDER in which the messages to forward are located, and a RANGE |
81 MESSAGES' numbers. | 81 of messages, which defaults to the current message in that |
82 folder. Check the documentation of `mh-interactive-range' to see | |
83 how RANGE is read in interactive use. | |
82 | 84 |
83 The option `mh-compose-insertion' controls what type of tags are inserted." | 85 The option `mh-compose-insertion' controls what type of tags are inserted." |
84 (interactive (let* | 86 (interactive |
85 ((description (mml-minibuffer-read-description)) | 87 (let* ((description |
86 (folder (mh-prompt-for-folder "Message from" | 88 (mml-minibuffer-read-description)) |
87 mh-sent-from-folder nil)) | 89 (folder |
88 (messages (let ((default-message | 90 (mh-prompt-for-folder "Message from" |
89 (if (and (equal | 91 mh-sent-from-folder nil)) |
90 folder mh-sent-from-folder) | 92 (default |
91 (numberp mh-sent-from-msg)) | 93 (if (and (equal folder mh-sent-from-folder) |
92 mh-sent-from-msg | 94 (numberp mh-sent-from-msg)) |
93 (nth 0 (mh-translate-range | 95 mh-sent-from-msg |
94 folder "cur"))))) | 96 (nth 0 (mh-translate-range folder "cur")))) |
95 (if default-message | 97 (range |
96 (read-string | 98 (mh-read-range "Forward" folder |
97 (format "Messages (default %d): " | 99 (or (and default |
98 default-message) | 100 (number-to-string default)) |
99 nil nil | 101 t) |
100 (number-to-string default-message)) | 102 t t))) |
101 (read-string (format "Messages: ")))))) | 103 (list description folder range))) |
102 (list description folder messages))) | 104 (let ((messages (mapconcat 'identity (mh-list-to-string range) " "))) |
103 (let | 105 (dolist (message (mh-translate-range folder messages)) |
104 ((range)) | |
105 (if (null messages) | |
106 (setq messages "")) | |
107 (setq range (mh-translate-range folder messages)) | |
108 (if (null range) | |
109 (error "No messages in specified range")) | |
110 (dolist (message range) | |
111 (if (equal mh-compose-insertion 'mml) | 106 (if (equal mh-compose-insertion 'mml) |
112 (mh-mml-forward-message description folder (format "%s" message)) | 107 (mh-mml-forward-message description folder (format "%s" message)) |
113 (mh-mh-forward-message description folder (format "%s" message)))))) | 108 (mh-mh-forward-message description folder (format "%s" message)))))) |
114 | 109 |
115 ;; To do: | 110 ;; To do: |
132 "multipart" "message") t) | 127 "multipart" "message") t) |
133 "/[-.+a-zA-Z0-9]+") | 128 "/[-.+a-zA-Z0-9]+") |
134 "Regexp matching valid media types used in MIME attachment compositions.") | 129 "Regexp matching valid media types used in MIME attachment compositions.") |
135 | 130 |
136 (defvar mh-have-file-command 'undefined | 131 (defvar mh-have-file-command 'undefined |
137 "Cached value of `mh-have-file-command'. | 132 "Cached value of function `mh-have-file-command'. |
138 Do not reference this variable directly as it might not have been | 133 Do not reference this variable directly as it might not have been |
139 initialized. Always use the command `mh-have-file-command'.") | 134 initialized. Always use the command `mh-have-file-command'.") |
140 | 135 |
141 ;;;###mh-autoload | 136 ;;;###mh-autoload |
142 (defun mh-have-file-command () | 137 (defun mh-have-file-command () |