:type 'sexp)
(defcustom message-generate-headers-first nil
- "*If non-nil, generate all possible headers before composing."
+ "*If non-nil, generate all required headers before composing."
:group 'message-headers
:type 'boolean)
(defun message-newline-and-reformat (&optional not-break)
"Insert four newlines, and then reformat if inside quoted text."
(interactive)
- (let (quoted point beg end leading-space)
+ (let (quoted point beg end leading-space bolp)
(setq point (point))
(beginning-of-line)
(setq beg (point))
+ (setq bolp (= beg point))
;; Find first line of the paragraph.
(if not-break
(while (and (not (eobp))
(setq leading-space (match-string 0)))
(if (and quoted
(not not-break)
+ (not bolp)
(< (- point beg) (length quoted)))
- ;; break in the cite prefix.
+ ;; break inside the cite prefix.
(setq quoted nil
end nil))
(if quoted
(narrow-to-region beg end)
(if not-break
(setq point nil)
- (insert "\n\n")
+ (if bolp
+ (insert "\n")
+ (insert "\n\n"))
(setq point (point))
(insert "\n\n")
(delete-region (point) (re-search-forward "[ \t]*"))
- (when quoted
+ (when (and quoted (not bolp))
(insert quoted leading-space)))
(if quoted
(let* ((adaptive-fill-regexp
the message."
(concat "Fwd: " subject))
-(defun message-make-forward-subject ()
+(defun message-make-forward-subject (&optional decoded)
"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
- (nnheader-decode-subject subject)
+ (if decoded
+ subject
+ (nnheader-decode-subject subject))
""))
(if message-wash-forwarded-subjects
(setq subject (message-wash-subject subject)))
(when lines
(insert lines))
(setq content-type-p
- (re-search-backward "^Content-Type:" nil t)))
+ (or mml-boundary
+ (re-search-backward "^Content-Type:" nil t))))
(save-restriction
(message-narrow-to-headers-or-head)
(message-remove-first-header "Content-Type")