+2001-02-16 22:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * message.el (message-do-send-housekeeping): Rename to a better
+ name.
+
2001-02-16 18:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
* message.el (message-cancel-news): Check article first, then ask
;; Rename the buffer.
(if message-send-rename-function
(funcall message-send-rename-function)
- (when (string-match "\\`\\*\\(unsent \\)?" (buffer-name))
- (rename-buffer
- (concat "*sent " (substring (buffer-name) (match-end 0))) t)))
+ (when (string-match "\\`\\*\\(sent \\|unsent \\)?\\(.+\\)\\*[^\\*]*"
+ (buffer-name))
+ (let ((name (match-string 2 (buffer-name)))
+ to group)
+ (if (not (or (string-equal name "mail")
+ (string-equal name "news")))
+ (setq name (concat "*sent " name "*"))
+ (setq to (message-fetch-field "to"))
+ (setq group (message-fetch-field "newsgroups"))
+ (setq name
+ (cond
+ (to (concat "*sent mail to "
+ (or (car (mail-extract-address-components to))
+ to) "*"))
+ ((and group (not (string= group "")))
+ (concat "*sent news on " group "*"))
+ (t "*sent mail*"))))
+ (unless (string-equal name (buffer-name))
+ (rename-buffer name t)))))
;; Push the current buffer onto the list.
(when message-max-buffers
(setq message-buffer-list
(subject (message-fetch-field "Subject")))
(setq subject
(if subject
- (if decoded
+ (if decoded
subject
(mail-decode-encoded-word-string subject))
""))