From: yamaoka Date: Mon, 17 May 2004 00:37:20 +0000 (+0000) Subject: Synch to No Gnus 200405170032. X-Git-Tag: t-gnus-6_17_4-quimby-~929 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60f777d53c1e4d94d09cd10c9f5ec24ff4c4187d;p=elisp%2Fgnus.git- Synch to No Gnus 200405170032. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3c415d1..8aca415 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2004-05-17 Lars Magne Ingebrigtsen + * rfc2047.el (rfc2047-field-value): Strip props. + + * mail-parse.el (mail-header-make-address): New alias. + + * ietf-drums.el (ietf-drums-make-address): New function. + * imap.el: Add compiler directives. * gnus-score.el (gnus-score-edit-done): run-hook->run-hooks. diff --git a/lisp/ietf-drums.el b/lisp/ietf-drums.el index eec283b..07fbc46 100644 --- a/lisp/ietf-drums.el +++ b/lisp/ietf-drums.el @@ -263,6 +263,11 @@ backslash and doublequote.") (concat "\"" string "\"") string)) +(defun ietf-drums-make-address (name address) + (if name + (concat (ietf-drums-quote-string name) " <" address ">") + address)) + (provide 'ietf-drums) ;;; ietf-drums.el ends here diff --git a/lisp/mail-parse.el b/lisp/mail-parse.el index a5de09b..951a967 100644 --- a/lisp/mail-parse.el +++ b/lisp/mail-parse.el @@ -58,6 +58,7 @@ (defalias 'mail-header-parse-date 'ietf-drums-parse-date) (defalias 'mail-narrow-to-head 'ietf-drums-narrow-to-header) (defalias 'mail-quote-string 'ietf-drums-quote-string) +(defalias 'mail-header-make-address 'ietf-drums-make-address) (defalias 'mail-header-fold-field 'rfc2047-fold-field) (defalias 'mail-header-unfold-field 'rfc2047-unfold-field) diff --git a/lisp/message.el b/lisp/message.el index 760f440..9e21461 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -2354,13 +2354,25 @@ Point is left at the beginning of the narrowed-to region." (defun message-delete-address () "Delete the address under point." (interactive) - (let ((start (point)) - (quote nil)) - (message-narrow-to-field) - (while (and (not (eobp)) - (or (not (eq (setq char (following-char)) ?,)) - (not quote))) - ()))) + (let ((first t) + current-header addresses) + (save-restriction + (message-narrow-to-field) + (re-search-backward "[\t\n ,]" nil t) + (when (re-search-forward "[^\t\n ,]@[^\t\n ,]" nil t) + (setq current-header (match-string 0) + addresses (replace-regexp-in-string + "[\n\t]" " " (mail-header-field-value))) + (goto-char (point-min)) + (re-search-forward ": ?") + (delete-region (point) (point-max)) + (dolist (address (mail-header-parse-addresses addresses)) + (unless first + (insert ", ")) + (setq first nil) + (unless (string-match (regexp-quote current-header) (car address)) + (insert (mail-header-make-address + (cdr address) (car address))))))))) diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index 1f07cb6..059d350 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -134,7 +134,7 @@ This is either `base64' or `quoted-printable'." (save-restriction (rfc2047-narrow-to-field) (re-search-forward ":[ \t\n]*" nil t) - (buffer-substring (point) (point-max))))) + (buffer-substring-no-properties (point) (point-max))))) (defvar rfc2047-encoding-type 'address-mime "The type of encoding done by `rfc2047-encode-region'.