2001-11-30 21:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 1 Dec 2001 02:49:27 +0000 (02:49 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Sat, 1 Dec 2001 02:49:27 +0000 (02:49 +0000)
* message.el: New variable message-subscribed-address-file;
use it in message-make-mft.  From Paul Jarc <prj@po.cwru.edu>.

lisp/ChangeLog
lisp/message.el

index e54489c..c4e2714 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-30 21:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * message.el: New variable message-subscribed-address-file;
+       use it in message-make-mft.  From Paul Jarc <prj@po.cwru.edu>.
+
 2001-11-30 12:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * message.el (message-tab-body-function): Set to nil.
index e0e0a11..ea6eaca 100644 (file)
@@ -437,6 +437,13 @@ conjunction with `message-subscribed-regexps' and
   :group 'message-interface
   :type '(repeat sexp))
 
+(defcustom message-subscribed-address-file nil
+  "*A file containing addresses the user is subscribed to.
+If nil, do not look at any files to determine list subscriptions.  If
+non-nil, each line of this file should be a mailing list address."
+  :group 'message-interface
+  :type 'string)
+
 (defcustom message-subscribed-addresses nil
   "*Specifies a list of addresses the user is subscribed to.
 If nil, do not use any predefined list subscriptions.  This list of
@@ -2715,6 +2722,7 @@ It should typically alter the sending method in some way or other."
       ;; Generate the Mail-Followup-To header if the header is not there...
       (if (and (or message-subscribed-regexps
                   message-subscribed-addresses
+                  message-subscribed-address-file
                   message-subscribed-address-functions)
               (not (mail-fetch-field "mail-followup-to")))
          (setq headers
@@ -3766,9 +3774,25 @@ give as trustworthy answer as possible."
         (recipients
          (mapcar 'mail-strip-quoted-names
                  (message-tokenize-header msg-recipients)))
+        (file-regexps
+         (if message-subscribed-address-file
+             (let (begin end item re)
+               (save-excursion
+                 (with-temp-buffer
+                   (insert-file-contents message-subscribed-address-file)
+                   (while (not (eobp))
+                     (setq begin (point))
+                     (forward-line 1)
+                     (setq end (point))
+                     (if (bolp) (setq end (1- end)))
+                     (setq item (regexp-quote (buffer-substring begin end)))
+                     (if re (setq re (concat re "\\)\\|\\(" item))
+                       (setq re (concat "\\`\\(" item))))
+                   (and re (list (concat re "\\)\\'"))))))))
         (mft-regexps (apply 'append message-subscribed-regexps
                             (mapcar 'regexp-quote
                                     message-subscribed-addresses)
+                            file-regexps
                             (mapcar 'funcall
                                     message-subscribed-address-functions))))
     (save-match-data