* gnus-art.el (gnus-ignored-headers): Add some more headers.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 12 Apr 2006 07:50:02 +0000 (07:50 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 12 Apr 2006 07:50:02 +0000 (07:50 +0000)
* ietf-drums.el (ietf-drums-parse-addresses): Take a RAWP
parameter to say whether to actually parse the individual
addresses.

* message.el (message-put-addresses-in-ecomplete): New function.
(ecomplete): Require.
(message-mail-alias-type): Add ecomplete as an option.

lisp/ChangeLog
lisp/gnus-art.el
lisp/ietf-drums.el
lisp/message.el

index 970b591..63d735b 100644 (file)
@@ -1,3 +1,15 @@
+2006-04-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-art.el (gnus-ignored-headers): Add some more headers.
+
+       * ietf-drums.el (ietf-drums-parse-addresses): Take a RAWP
+       parameter to say whether to actually parse the individual
+       addresses. 
+
+       * message.el (message-put-addresses-in-ecomplete): New function.
+       (ecomplete): Require.
+       (message-mail-alias-type): Add ecomplete as an option.
+
 2006-04-12  Ralf Angeli  <angeli@iwi.uni-sb.de>
 
        * flow-fill.el (fill-flowed): Remove trailing space from blank
index 053c8a7..f34506e 100644 (file)
      "X-Virus-Scanned" "X-Delivery-Agent" "Posted-Date" "X-Gateway"
      "X-Local-Origin" "X-Local-Destination" "X-UserInfo1"
      "X-Received-Date" "X-Hashcash" "Face" "X-DMCA-Notifications"
-     "X-Abuse-and-DMCA-Info" "X-Postfilter" "X-Gpg-.*" "X-Disclaimer"))
+     "X-Abuse-and-DMCA-Info" "X-Postfilter" "X-Gpg-.*" "X-Disclaimer"
+     "Envelope-To" "X-Spam-Score" "System-Type" "X-Injected-Via-Gmane"
+     "X-Gmane-NNTP-Posting-Host" "Jabber-ID" "Archived-At"
+     "Envelope-Sender" "Envelope-Recipients"))
   "*All headers that start with this regexp will be hidden.
 This variable can also be a list of regexps of headers to be ignored.
 If `gnus-visible-headers' is non-nil, this variable will be ignored."
index 0d9e3a5..2aef1dd 100644 (file)
@@ -213,8 +213,10 @@ backslash and doublequote.")
             (ietf-drums-get-comment string)))
        (cons mailbox display-string)))))
 
-(defun ietf-drums-parse-addresses (string)
-  "Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs."
+(defun ietf-drums-parse-addresses (string &optional rawp)
+  "Parse STRING and return a list of MAILBOX / DISPLAY-NAME pairs.
+If RAWP, don't actually parse the addresses, but instead return
+a list of address strings."
   (if (null string)
       nil
     (with-temp-buffer
@@ -231,20 +233,24 @@ backslash and doublequote.")
               (skip-chars-forward "^,"))))
           ((eq c ?,)
            (setq address
-                 (condition-case nil
-                     (ietf-drums-parse-address
-                      (buffer-substring beg (point)))
-                   (error nil)))
+                 (if rawp
+                     (buffer-substring beg (point))
+                   (condition-case nil
+                       (ietf-drums-parse-address
+                        (buffer-substring beg (point)))
+                     (error nil))))
            (if address (push address pairs))
            (forward-char 1)
            (setq beg (point)))
           (t
            (forward-char 1))))
        (setq address
-             (condition-case nil
-                 (ietf-drums-parse-address
-                  (buffer-substring beg (point)))
-               (error nil)))
+             (if rawp
+                 (buffer-substring beg (point))
+               (condition-case nil
+                   (ietf-drums-parse-address
+                    (buffer-substring beg (point)))
+                 (error nil))))
        (if address (push address pairs))
        (nreverse pairs)))))
 
index 4212edb..9c3fb9a 100644 (file)
@@ -49,6 +49,7 @@
 (require 'mail-parse)
 (require 'mml)
 (require 'rfc822)
+(require 'ecomplete)
 
 (defgroup message '((user-mail-address custom-variable)
                    (user-full-name custom-variable))
@@ -1085,6 +1086,7 @@ mail aliases off."
   :group 'message
   :link '(custom-manual "(message)Mail Aliases")
   :type '(choice (const :tag "Use Mailabbrev" abbrev)
+                (const :tag "Use ecomplete" ecomplete)
                 (const :tag "No expansion" nil)))
 
 (defcustom message-auto-save-directory
@@ -3594,6 +3596,9 @@ It should typically alter the sending method in some way or other."
       (save-excursion
        (run-hooks 'message-sent-hook))
       (message "Sending...done")
+      ;; Do ecomplete address snarfing.
+      (when (eq message-mail-alias-type 'ecomplete)
+       (message-put-addresses-in-ecomplete))
       ;; Mark the buffer as unmodified and delete auto-save.
       (set-buffer-modified-p nil)
       (delete-auto-save-file-if-necessary t)
@@ -7155,6 +7160,13 @@ From headers in the original article."
        (not result)
       result)))
 
+(defun message-put-addresses-in-ecomplete ()
+  (dolist (header '("to" "cc" "from" "reply-to"))
+    (let ((value (message-fetch-field header)))
+      (dolist (string (mail-header-parse-addresses value 'raw))
+       (ecomplete-add-item 'mail (car (mail-header-parse-address string))
+                           string)))))
+
 (when (featurep 'xemacs)
   (require 'messagexmas)
   (message-xmas-redefine))