[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/gnus/message.el
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/gnus/message.el |
Date: |
Wed, 28 Sep 2005 01:26:05 -0400 |
Index: emacs/lisp/gnus/message.el
diff -c emacs/lisp/gnus/message.el:1.88 emacs/lisp/gnus/message.el:1.89
*** emacs/lisp/gnus/message.el:1.88 Sat Sep 24 13:46:19 2005
--- emacs/lisp/gnus/message.el Wed Sep 28 05:26:01 2005
***************
*** 2030,2035 ****
--- 2030,2043 ----
;;; End of functions adopted from `message-utils.el'.
+ (defun message-remove-duplicates (list)
+ (let (new)
+ (while list
+ (or (member (car list) new)
+ (setq new (cons (car list) new)))
+ (setq list (cdr list)))
+ (nreverse new)))
+
(defun message-remove-header (header &optional is-regexp first reverse)
"Remove HEADER in the narrowed buffer.
If IS-REGEXP, HEADER is a regular expression.
***************
*** 4957,4969 ****
(let ((field (message-fetch-field header))
rhs ace address)
(when field
! (dolist (address (mail-header-parse-addresses field))
! (setq address (car address)
! rhs (downcase (or (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))
(while (re-search-forward (concat "^" header ":") nil t)
(message-narrow-to-field)
--- 4965,4981 ----
(let ((field (message-fetch-field header))
rhs ace address)
(when field
! (dolist (rhs
! (message-remove-duplicates
! (mapcar (lambda (rhs) (or (cadr (split-string rhs "@")) ""))
! (mapcar 'downcase
! (mapcar
! 'car (mail-header-parse-addresses field))))))
! (setq 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 in %s:? "
! rhs ace header))))
(goto-char (point-min))
(while (re-search-forward (concat "^" header ":") nil t)
(message-narrow-to-field)
***************
*** 4982,4987 ****
--- 4994,5002 ----
(message-narrow-to-head)
(message-idna-to-ascii-rhs-1 "From")
(message-idna-to-ascii-rhs-1 "To")
+ (message-idna-to-ascii-rhs-1 "Reply-To")
+ (message-idna-to-ascii-rhs-1 "Mail-Reply-To")
+ (message-idna-to-ascii-rhs-1 "Mail-Followup-To")
(message-idna-to-ascii-rhs-1 "Cc")))))
(defun message-generate-headers (headers)