:type 'regexp)
(defcustom message-cite-prefix-regexp
- ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
- "\\([ \t]*\\(\\w\\|[-_.]\\)+>+\\|[ \t]*[]>»|:}+]\\)+"
+ (if (string-match "[[:digit:]]" "1") ;; support POSIX?
+ "\\([ \t]*[-_.[:word:]]+>+\\|[ \t]*[]>»|:}+]\\)+"
+ ;; ?-, ?_ or ?. MUST NOT be in syntax entry w.
+ "\\([ \t]*\\(\\w\\|[-_.]\\)+>+\\|[ \t]*[]>»|:}+]\\)+")
"*Regexp matching the longest possible citation prefix on a line."
:group 'message-insertion
:type 'regexp)
:group 'message-interface
:type '(choice function (const nil)))
-(defcustom message-use-followup-to 'ask
+(defcustom message-use-followup-to t
"*Specifies what to do with Followup-To header.
If nil, always ignore the header. If it is t, use its value, but
query before using the \"poster\" value. If it is the symbol `ask',
`use', always use the value."
:group 'message-interface
:type '(choice (const :tag "ignore" nil)
+ (const :tag "use & query" t)
(const :tag "maybe" t)
(const :tag "always" use)
(const :tag "ask" ask)))
:type 'sexp)
(defcustom message-generate-headers-first nil
- "*If non-nil, generate all required headers before composing."
+ "*If non-nil, generate all required headers before composing.
+The variables `message-required-news-headers' and
+`message-required-mail-headers' specify which headers to generate.
+
+Note that the variable `message-deletable-headers' specifies headers which
+are to be deleted and then re-generated before sending, so this variable
+will not have a visible effect for those headers."
:group 'message-headers
:type 'boolean)
(integer :tag "Position from last ID"))
:group 'message-insertion)
+(defcustom message-yank-cited-prefix ">"
+ "*Prefix inserted on cited lines of yanked messages.
+Fix `message-cite-prefix-regexp' if it is set to an abnormal value."
+ :type 'string
+ :group 'message-insertion)
+
(defcustom message-indentation-spaces 3
"*Number of spaces to insert at the beginning of each cited line.
Used by `message-yank-original' via `message-yank-cite'."
;;;###autoload
(defcustom message-signature-file "~/.signature"
- "*File containing the text inserted at end of message buffer."
- :type 'file
+ "*Name of file containing the text inserted at end of message buffer.
+Ignored if the named file doesn't exist.
+If nil, don't insert a signature."
+ :type '(choice file (const :tags "None" nil))
:group 'message-insertion)
(defcustom message-distribution-function nil
(defcustom message-dont-reply-to-names
(and (boundp 'rmail-dont-reply-to-names) rmail-dont-reply-to-names)
- "*A regexp specifying names to prune when doing wide replies.
-A value of nil means exclude your own name only."
+ "*A regexp specifying addresses to prune when doing wide replies.
+A value of nil means exclude your own user name only."
:version "21.1"
:group 'message
:type '(choice (const :tag "Yourself" nil)
(autoload 'gnus-request-post "gnus-int")
(autoload 'gnus-copy-article-buffer "gnus-msg")
(autoload 'gnus-alive-p "gnus-util")
+ (autoload 'gnus-server-string "gnus")
(autoload 'gnus-group-name-charset "gnus-group")
- (autoload 'rmail-output "rmail")
+ (autoload 'rmail-output "rmailout")
(autoload 'mu-cite-original "mu-cite"))
\f
(define-key message-mode-map "\C-c\C-v" 'message-delete-not-region)
(define-key message-mode-map "\C-c\C-z" 'message-kill-to-signature)
(define-key message-mode-map "\M-\r" 'message-newline-and-reformat)
- (define-key message-mode-map "\M-q" 'message-fill-paragraph)
+ ;;(define-key message-mode-map "\M-q" 'message-fill-paragraph)
(define-key message-mode-map "\t" 'message-tab)
(define-key message-mode-map "\M-;" 'comment-region)
(defun message-setup-fill-variables ()
"Setup message fill variables."
+ (set (make-local-variable 'fill-paragraph-function)
+ 'message-fill-paragraph)
(make-local-variable 'paragraph-separate)
(make-local-variable 'paragraph-start)
(make-local-variable 'adaptive-fill-regexp)
(unless (bolp)
(insert "\n"))))
-(defun message-newline-and-reformat (&optional not-break)
- "Insert four newlines, and then reformat if inside quoted text."
- (interactive)
+(defun message-newline-and-reformat (&optional arg not-break)
+ "Insert four newlines, and then reformat if inside quoted text.
+Prefix arg means justify as well."
+ (interactive (list (if current-prefix-arg 'full)))
(let (quoted point beg end leading-space bolp)
(setq point (point))
(beginning-of-line)
(regexp-quote (concat quoted leading-space)))
(adaptive-fill-first-line-regexp
adaptive-fill-regexp ))
- (fill-paragraph nil))
- (fill-paragraph nil))
+ (fill-paragraph arg))
+ (fill-paragraph arg))
(if point (goto-char point)))))
-(defun message-fill-paragraph ()
+(defun message-fill-paragraph (&optional arg)
"Like `fill-paragraph'."
- (interactive)
- (message-newline-and-reformat t))
+ (interactive (list (if current-prefix-arg 'full)))
+ (message-newline-and-reformat arg t)
+ t)
(defun message-insert-signature (&optional force)
"Insert a signature. See documentation for variable `message-signature'."
(save-excursion
(goto-char start)
(while (< (point) (mark t))
- (insert message-yank-prefix)
+ (if (looking-at message-cite-prefix-regexp)
+ (insert message-yank-cited-prefix)
+ (insert message-yank-prefix))
(forward-line 1))))
(goto-char start)))
(when message-indent-citation-function
(if (listp message-indent-citation-function)
message-indent-citation-function
- (list message-indent-citation-function)))))
+ (list message-indent-citation-function))))
+ (message-reply-headers (or message-reply-headers
+ (make-mail-header))))
+ (mail-header-set-from message-reply-headers
+ (save-restriction
+ (narrow-to-region
+ (point)
+ (if (search-forward "\n\n" nil t)
+ (1- (point))
+ (point-max)))
+ (or (message-fetch-field "from")
+ "unknown sender")))
;; Allow undoing.
(undo-boundary)
(goto-char end)
(set-buffer message-encoding-buffer)
(erase-buffer)
;; Avoid copying text props.
- (insert (with-current-buffer message-edit-buffer
- (buffer-substring-no-properties (point-min) (point-max))))
+ (let (message-invisibles)
+ (insert
+ (with-current-buffer message-edit-buffer
+ (setq message-invisibles (message-find-invisible-regions))
+ (buffer-substring-no-properties (point-min) (point-max))))
+ ;; Inherit the invisible property of texts to make MIME-Edit
+ ;; find the MIME part boundaries.
+ (dolist (region message-invisibles)
+ (put-text-property (car region) (cdr region) 'invisible t)))
(funcall message-encode-function)
(while (and success
(setq elem (pop alist)))
(eval-after-load "invisible"
'(defalias 'invisible-region 'message-invisible-region))
+(defun message-find-invisible-regions ()
+ "Find invisible texts with the property `message-invisible' and
+return a list of points."
+ (let (from
+ (to (point-min))
+ regions)
+ (while (setq from (text-property-any to (point-max)
+ 'message-invisible t))
+ (setq to (or (text-property-not-all from (point-max)
+ 'message-invisible t)
+ (point-max)))
+ (push (cons from to) regions))
+ regions))
+
(defun message-fix-before-sending ()
"Do various things to make the message nice before sending it."
;; Make sure there's a newline at the end of the message.
(insert "\n"))
;; Expose all invisible text with the property `message-invisible'.
;; We should believe that the things might be created by MIME-Edit.
- (let (start)
- (while (setq start (text-property-any (point-min) (point-max)
- 'message-invisible t))
- (remove-text-properties start
- (or (text-property-not-all start (point-max)
- 'message-invisible t)
- (point-max))
- '(invisible nil message-invisible nil))))
- ;; Expose all invisible text.
- (message-check 'invisible-text
- (when (text-property-any (point-min) (point-max) 'invisible t)
- (put-text-property (point-min) (point-max) 'invisible nil)
- (unless (yes-or-no-p
- "Invisible text found and made visible; continue posting? ")
- (error "Invisible text found and made visible")))))
+ (let ((message-invisibles (message-find-invisible-regions)))
+ (dolist (region message-invisibles)
+ (put-text-property (car region) (cdr region) 'invisible nil))
+ ;; Expose all invisible text.
+ (message-check 'invisible-text
+ (when (text-property-any (point-min) (point-max) 'invisible t)
+ (put-text-property (point-min) (point-max) 'invisible nil)
+ (unless (yes-or-no-p
+ "Invisible text found and made visible; continue posting? ")
+ (error "Invisible text found and made visible"))))
+ ;; Hide again all text with the property `message-invisible'.
+ ;; It is needed to make MIME-Edit find the MIME part boundaries.
+ (dolist (region message-invisibles)
+ (put-text-property (car region) (cdr region) 'invisible t))))
(defun message-add-action (action &rest types)
"Add ACTION to be performed when doing an exit of type TYPES."
(prin1-to-string failure)))))
(defun message-send-mail-partially ()
- "Sendmail as message/partial."
+ "Send mail as message/partial."
;; replace the header delimiter with a blank line
(goto-char (point-min))
(re-search-forward
(message-generate-headers message-required-news-headers)
;; Let the user do all of the above.
(run-hooks 'message-header-hook))
- (if group-name-charset
- (setq message-syntax-checks
- (cons '(valid-newsgroups . disabled)
- message-syntax-checks)))
+ (when group-name-charset
+ (setq message-syntax-checks
+ (cons '(valid-newsgroups . disabled)
+ message-syntax-checks)))
(message-cleanup-headers)
(if (not (message-check-news-syntax))
nil
(backward-char 1)
(run-hooks 'message-send-news-hook)
(gnus-open-server method)
+ (message "Sending news with %s..." (gnus-server-string method))
(gnus-request-post method)
))
(hashtb (and (boundp 'gnus-active-hashtb)
gnus-active-hashtb))
errors)
- (if (or (not hashtb)
- (not (boundp 'gnus-read-active-file))
- (not gnus-read-active-file)
- (eq gnus-read-active-file 'some))
- t
- (while groups
- (when (and (not (boundp (intern (car groups) hashtb)))
- (not (equal (car groups) "poster")))
- (push (car groups) errors))
- (pop groups))
- (if (not errors)
- t
- (y-or-n-p
- (format
- "Really post to %s unknown group%s: %s? "
- (if (= (length errors) 1) "this" "these")
- (if (= (length errors) 1) "" "s")
- (mapconcat 'identity errors ", ")))))))
- ;; Check the Newsgroups & Followup-To headers for syntax errors.
- (message-check 'valid-newsgroups
- (let ((case-fold-search t)
- (headers '("Newsgroups" "Followup-To"))
- header error)
- (while (and headers (not error))
- (when (setq header (mail-fetch-field (car headers)))
- (if (or
- (not
- (string-match
- "\\`\\([-+_&.a-zA-Z0-9]+\\)?\\(,[-+_&.a-zA-Z0-9]+\\)*\\'"
- header))
- (memq
- nil (mapcar
- (lambda (g)
- (not (string-match "\\.\\'\\|\\.\\." g)))
- (message-tokenize-header header ","))))
- (setq error t)))
- (unless error
- (pop headers)))
- (if (not error)
- t
+ (while groups
+ (when (and (not (boundp (intern (car groups) hashtb)))
+ (not (equal (car groups) "poster")))
+ (push (car groups) errors))
+ (pop groups))
+ (cond
+ ;; Gnus is not running.
+ ((or (not hashtb)
+ (not (boundp 'gnus-read-active-file)))
+ t)
+ ;; We don't have all the group names.
+ ((and (or (not gnus-read-active-file)
+ (eq gnus-read-active-file 'some))
+ errors)
(y-or-n-p
- (format "The %s header looks odd: \"%s\". Really post? "
- (car headers) header)))))
- (message-check 'repeated-newsgroups
- (let ((case-fold-search t)
- (headers '("Newsgroups" "Followup-To"))
- header error groups group)
- (while (and headers
- (not error))
- (when (setq header (mail-fetch-field (pop headers)))
- (setq groups (message-tokenize-header header ","))
- (while (setq group (pop groups))
- (when (member group groups)
- (setq error group
- groups nil)))))
- (if (not error)
- t
+ (format
+ "Really post to %s possibly unknown group%s: %s? "
+ (if (= (length errors) 1) "this" "these")
+ (if (= (length errors) 1) "" "s")
+ (mapconcat 'identity errors ", "))))
+ ;; There were no errors.
+ ((not errors)
+ t)
+ ;; There are unknown groups.
+ (t
(y-or-n-p
- (format "Group %s is repeated in headers. Really post? " error)))))
- ;; Check the From header.
- (message-check 'from
- (let* ((case-fold-search t)
- (from (message-fetch-field "from"))
- ad)
- (cond
- ((not from)
- (message "There is no From line. Posting is denied.")
- nil)
- ((or (not (string-match
- "@[^\\.]*\\."
- (setq ad (nth 1 (mail-extract-address-components
- from))))) ;larsi@ifi
- (string-match "\\.\\." ad) ;larsi@ifi..uio
- (string-match "@\\." ad) ;larsi@.ifi.uio
- (string-match "\\.$" ad) ;larsi@ifi.uio.
- (not (string-match "^[^@]+@[^@]+$" ad)) ;larsi.ifi.uio
- (string-match "(.*).*(.*)" from)) ;(lars) (lars)
- (message
- "Denied posting -- the From looks strange: \"%s\"." from)
- nil)
- (t t))))))
+ (format
+ "Really post to %s unknown group%s: %s? "
+ (if (= (length errors) 1) "this" "these")
+ (if (= (length errors) 1) "" "s")
+ (mapconcat 'identity errors ", ")))))))
+ ;; Check the Newsgroups & Followup-To headers for syntax errors.
+ (message-check 'valid-newsgroups
+ (let ((case-fold-search t)
+ (headers '("Newsgroups" "Followup-To"))
+ header error)
+ (while (and headers (not error))
+ (when (setq header (mail-fetch-field (car headers)))
+ (if (or
+ (not
+ (string-match
+ "\\`\\([-+_&.a-zA-Z0-9]+\\)?\\(,[-+_&.a-zA-Z0-9]+\\)*\\'"
+ header))
+ (memq
+ nil (mapcar
+ (lambda (g)
+ (not (string-match "\\.\\'\\|\\.\\." g)))
+ (message-tokenize-header header ","))))
+ (setq error t)))
+ (unless error
+ (pop headers)))
+ (if (not error)
+ t
+ (y-or-n-p
+ (format "The %s header looks odd: \"%s\". Really post? "
+ (car headers) header)))))
+ (message-check 'repeated-newsgroups
+ (let ((case-fold-search t)
+ (headers '("Newsgroups" "Followup-To"))
+ header error groups group)
+ (while (and headers
+ (not error))
+ (when (setq header (mail-fetch-field (pop headers)))
+ (setq groups (message-tokenize-header header ","))
+ (while (setq group (pop groups))
+ (when (member group groups)
+ (setq error group
+ groups nil)))))
+ (if (not error)
+ t
+ (y-or-n-p
+ (format "Group %s is repeated in headers. Really post? " error)))))
+ ;; Check the From header.
+ (message-check 'from
+ (let* ((case-fold-search t)
+ (from (message-fetch-field "from"))
+ ad)
+ (cond
+ ((not from)
+ (message "There is no From line. Posting is denied.")
+ nil)
+ ((or (not (string-match
+ "@[^\\.]*\\."
+ (setq ad (nth 1 (mail-extract-address-components
+ from))))) ;larsi@ifi
+ (string-match "\\.\\." ad) ;larsi@ifi..uio
+ (string-match "@\\." ad) ;larsi@.ifi.uio
+ (string-match "\\.$" ad) ;larsi@ifi.uio.
+ (not (string-match "^[^@]+@[^@]+$" ad)) ;larsi.ifi.uio
+ (string-match "(.*).*(.*)" from)) ;(lars) (lars)
+ (message
+ "Denied posting -- the From looks strange: \"%s\"." from)
+ nil)
+ (t t))))))
(defun message-check-news-body-syntax ()
(and
(goto-char (point-min))
(re-search-forward
(concat "^" (regexp-quote mail-header-separator) "$"))
+ (forward-line 1)
(while (and
- (progn
- (end-of-line)
- (< (current-column) 80))
+ (or (looking-at
+ mime-edit-tag-regexp)
+ (let ((p (point)))
+ (end-of-line)
+ (< (- (point) p) 80)))
(zerop (forward-line 1))))
(or (bolp)
(eobp)
;; 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)))
+ ;; Note: mail-abbrevs of XEmacs renames buffer name behind Gnus.
+ (when (string-match
+ "\\`\\*\\(sent \\|unsent \\)?\\(.+\\)\\*[^\\*]*\\|\\`mail to "
+ (buffer-name))
+ (let ((name (match-string 2 (buffer-name)))
+ to group)
+ (if (not (or (null name)
+ (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
(if (gnus-alive-p)
(setq message-draft-article
(nndraft-request-associate-buffer "drafts"))
- (setq buffer-file-name (expand-file-name "*message*"
- message-auto-save-directory))
+ (setq buffer-file-name (expand-file-name
+ (if (eq system-type 'windows-nt)
+ "message"
+ "*message*")
+ message-auto-save-directory))
(setq buffer-auto-save-file-name (make-auto-save-file-name)))
(clear-visited-file-modtime)
(static-if (boundp 'MULE)
(nconc
`((To . ,(or to "")) (Subject . ,(or subject "")))
(when other-headers other-headers))
- replybuffer)
+ replybuffer send-actions)
;; FIXME: Should return nil if failure.
t))
mrt (when message-use-mail-reply-to
(message-fetch-field "mail-reply-to"))
mft (when (and (not (or to-address mrt reply-to))
- message-use-mail-followup-to)
+ (or message-use-followup-to
+ message-use-mail-followup-to))
(message-fetch-field "mail-followup-to")))
;; Handle special values of Mail-Copies-To.
;; Handle Mail-Followup-To.
(when (and mft
- (eq message-use-mail-followup-to 'ask)
+ (eq (or message-use-followup-to
+ message-use-mail-followup-to) 'ask)
(not (message-y-or-n-p
(concat "Obey Mail-Followup-To: " mft "? ") t "\
You should normally obey the Mail-Followup-To: header.
"that mailing list") ".")))
(setq mft nil))
- (if (or (not wide)
- to-address)
+ (if (and (not mft)
+ (or (not wide)
+ to-address))
(progn
(setq follow-to (list (cons 'To
(or to-address mrt reply-to mft from))))
- (when (and wide (or mft mct)
- (not (member (cons 'To (or mft mct)) follow-to)))
+ (when (and wide mct
+ (not (member (cons 'To mct) follow-to)))
(push (cons 'Cc mct) follow-to)))
(let (ccalist)
(save-excursion
(message-set-work-buffer)
(if (and mft
message-use-followup-to
+ wide
(or (not (eq message-use-followup-to 'ask))
(message-y-or-n-p "Obey Mail-Followup-To? " t "\
You should normally obey the Mail-Followup-To: header. In this
because discussions that are spread over several lists tend to be
fragmented and very difficult to follow.
-Also, some source/announcement lists are not indented for discussion;
+Also, some source/announcement lists are not intended for discussion;
responses here are directed to other addresses.")))
(insert mft)
(unless never-mct
(push ccs follow-to)))))
follow-to))
-
;;;###autoload
(defun message-reply (&optional to-address wide)
"Start editing a reply to the article in the current buffer."
distribution (message-fetch-field "distribution")
mct (when message-use-mail-copies-to
(message-fetch-field "mail-copies-to"))
- mft (when message-use-mail-followup-to
+ mft (when (or message-use-followup-to
+ message-use-mail-followup-to)
(message-fetch-field "mail-followup-to")))
(when (and (setq gnus-warning (message-fetch-field "gnus-warning"))
(string-match "<[^>]+>" gnus-warning))
because discussions that are spread over several newsgroup tend to
be fragmented and very difficult to follow.
-Also, some source/announcement newsgroups are not indented for discussion;
+Also, some source/announcement newsgroups are not intended for discussion;
responses here are directed to other newsgroups."))
(setq follow-to (list (cons 'Newsgroups followup-to)))
(setq follow-to (list (cons 'Newsgroups newsgroups)))))))
;; Handle Mail-Followup-To, followup via e-mail.
((and mft
- (or (not (eq message-use-mail-followup-to 'ask))
+ (or (not (eq (or message-use-followup-to
+ message-use-mail-followup-to) 'ask))
(message-y-or-n-p
(concat "Obey Mail-Followup-To: " mft "? ") t "\
You should normally obey the Mail-Followup-To: header.
(interactive "P")
(unless (message-news-p)
(error "This is not a news article; canceling is impossible"))
- (when (yes-or-no-p "Do you really want to cancel this article? ")
- (let (from newsgroups message-id distribution buf sender)
- (save-excursion
- ;; Get header info from original article.
- (save-restriction
- (message-narrow-to-head-1)
- (setq from (message-fetch-field "from")
- sender (message-fetch-field "sender")
- newsgroups (message-fetch-field "newsgroups")
- message-id (message-fetch-field "message-id" t)
- distribution (message-fetch-field "distribution")))
- ;; Make sure that this article was written by the user.
- (unless (or (message-gnksa-enable-p 'cancel-messages)
- (and sender
- (string-equal
- (downcase sender)
- (downcase (message-make-sender))))
- (string-equal
- (downcase (cadr (std11-extract-address-components
- from)))
- (downcase (cadr (std11-extract-address-components
- (message-make-from))))))
- (error "This article is not yours"))
+ (let (from newsgroups message-id distribution buf sender)
+ (save-excursion
+ ;; Get header info from original article.
+ (save-restriction
+ (message-narrow-to-head-1)
+ (setq from (message-fetch-field "from")
+ sender (message-fetch-field "sender")
+ newsgroups (message-fetch-field "newsgroups")
+ message-id (message-fetch-field "message-id" t)
+ distribution (message-fetch-field "distribution")))
+ ;; Make sure that this article was written by the user.
+ (unless (or (message-gnksa-enable-p 'cancel-messages)
+ (and sender
+ (string-equal
+ (downcase sender)
+ (downcase (message-make-sender))))
+ (string-equal
+ (downcase (cadr (std11-extract-address-components from)))
+ (downcase (cadr (std11-extract-address-components
+ (message-make-from))))))
+ (error "This article is not yours"))
+ (when (yes-or-no-p "Do you really want to cancel this article? ")
;; Make control message.
(if arg
(message-news)
mail-header-separator "\n"
message-cancel-message)
(run-hooks 'message-cancel-hook)
- (message "Canceling your article...")
(unless arg
+ (message "Canceling your article...")
(if (let ((message-syntax-checks
'dont-check-for-anything-just-trust-me)
(message-encoding-buffer (current-buffer))
;;; Forwarding messages.
+(defvar message-forward-decoded-p nil
+ "Non-nil means the original message is decoded.")
+
(defun message-forward-subject-author-subject (subject)
"Generate a SUBJECT for a forwarded message.
The form is: [Source] Subject, where if the original message was mail,
Source is the sender, and if the original message was news, Source is
the list of newsgroups is was posted to."
(concat "["
- (or (message-fetch-field
- (if (message-news-p) "newsgroups" "from"))
- "(nowhere)")
+ (if (message-news-p)
+ (or (message-fetch-field "newsgroups")
+ "(nowhere)")
+ (let ((from (message-fetch-field "from")))
+ (if from
+ (nnheader-decode-from from)
+ "(nobody)")))
"] " subject))
(defun message-forward-subject-fwd (subject)
the message."
(concat "Fwd: " subject))
-(defun message-make-forward-subject (&optional decoded)
+(defun message-make-forward-subject ()
"Return a Subject header suitable for the message in the current buffer."
(save-excursion
(save-restriction
(subject (message-fetch-field "Subject")))
(setq subject
(if subject
- (if decoded
+ (if message-forward-decoded-p
subject
(nnheader-decode-subject subject))
""))
(if (catch 'mime-edit-error
(save-excursion
(mime-edit-pgp-enclose-buffer)
- (mime-edit-translate-body)
- ))
- (error "Translation error!")
- )
- (end-of-invisible)
- (run-hooks 'mime-edit-exit-hook)
- ))
+ (mime-edit-translate-body)))
+ (error "Translation error!"))
+ (run-hooks 'mime-edit-exit-hook)))
(defun message-mime-insert-article (&optional full-headers)
(interactive "P")
(mail-strip-quoted-names
(message-fetch-field "from")))
(message-options-set 'message-recipients
- (mail-strip-quoted-names
- (message-fetch-field "to")))))
+ (mail-strip-quoted-names
+ (concat
+ (or (message-fetch-field "to") "") ", "
+ (or (message-fetch-field "cc") "") ", "
+ (or (message-fetch-field "bcc") ""))))))
(when (featurep 'xemacs)
(require 'messagexmas)
(interactive)
(message "Saving %s..." buffer-file-name)
(let ((reply-headers message-reply-headers)
- (msg (buffer-substring-no-properties (point-min) (point-max))))
+ (msg (buffer-substring-no-properties (point-min) (point-max)))
+ (message-invisibles (message-find-invisible-regions)))
(with-temp-file buffer-file-name
(insert msg)
+ ;; Inherit the invisible property of texts to make MIME-Edit
+ ;; find the MIME part boundaries.
+ (dolist (region message-invisibles)
+ (put-text-property (car region) (cdr region) 'invisible t))
(setq message-reply-headers reply-headers)
(message-generate-headers '((optional . In-Reply-To)))
(mime-edit-translate-buffer))