2004-05-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
+ * 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.
(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
(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)
(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)))))))))
\f
(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'.