"A regexp that matches the separator before the text of a failed message.")
(defvar message-field-fillers
- '((To message-fill-address)
- (Cc message-fill-address)
- (From message-fill-address))
+ '((To message-fill-field-address)
+ (Cc message-fill-field-address)
+ (From message-fill-field-address))
"Alist of header names/filler functions.")
(defvar message-header-format-alist
`((Newsgroups)
- (To . message-fill-address)
- (Cc . message-fill-address)
+ (To)
+ (Cc)
(Subject)
(In-Reply-To)
(Fcc)
(when field
(dolist (address (mail-header-parse-addresses field))
(setq address (car address)
- rhs (cadr (split-string address "@"))
- ace (idna-to-ascii rhs))
- (when (and (not (equalp rhs ace))
+ rhs (downcase (cadr (split-string address "@")))
+ ace (downcase (idna-to-ascii rhs)))
+ (when (and (not (equal rhs ace))
(or (not (eq message-use-idna 'ask))
(y-or-n-p (format "Replace %s with %s? " rhs ace))))
(goto-char (point-min))
(if formatter
(funcall formatter header value)
(insert header-string ": " value))
+ (goto-char (message-fill-field))
;; We check whether the value was ended by a
- ;; newline. If now, we insert one.
+ ;; newline. If not, we insert one.
(unless (bolp)
(insert "\n"))
(forward-line -1)))
(unless optionalp
(push header-string message-inserted-headers)
(insert value)
- (when (bolp)
- (delete-char -1))))
+ (message-fill-field)))
;; Add the deletable property to the headers that require it.
(and (memq header message-deletable-headers)
(progn (beginning-of-line) (looking-at "[^:]+: "))
(error
(split-line))))
-(defun message-fill-header (header value)
+(defun message-insert-header (header value)
(insert (capitalize (symbol-name header))
": "
- (if (consp value) (car value) value)
- "\n")
- (message-fill-field))
+ (if (consp value) (car value) value)))
(defun message-field-name ()
(save-excursion
(message-narrow-to-field)
(let ((field-name (message-field-name)))
(funcall (or (cadr (assq field-name message-field-fillers))
- 'message-fill-field-general))))))
+ 'message-fill-field-general)))
+ (point-max))))
(defun message-fill-field-address ()
(while (not (eobp))
(when message-this-is-news
(while (< 998
(with-temp-buffer
- (message-fill-header header (mapconcat #'identity refs " "))
+ (message-insert-header
+ header (mapconcat #'identity refs " "))
(buffer-size)))
(message-shorten-1 refs cut 1)))
;; Finally, collect the references back into a string and insert
;; it into the buffer.
- (message-fill-header header (mapconcat #'identity refs " "))))
+ (message-insert-header header (mapconcat #'identity refs " "))))
(defun message-position-point ()
"Move point to where the user probably wants to find it."