* more MFT address stuff
@ 2001-11-30 18:23 Paul Jarc
2001-11-30 20:14 ` Paul Jarc
0 siblings, 1 reply; 5+ messages in thread
From: Paul Jarc @ 2001-11-30 18:23 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
Here's a patch to enable support for $QMAILMFTFILE (or any other file
containing a list of subscribed addresses). Dunno if "*" is
appropriate for this variable's docstring. ChangeLog entry:
* message.el: New variable message-subscribed-address-file;
use it in message-make-mft. From Paul Jarc <prj@po.cwru.edu>.
paul
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: subscribed addresses file --]
[-- Type: text/x-patch, Size: 2198 bytes --]
Index: lisp/message.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/message.el,v
retrieving revision 6.171
diff -u -r6.171 message.el
--- lisp/message.el 2001/11/30 17:36:17 6.171
+++ lisp/message.el 2001/11/30 18:22:13
@@ -437,6 +437,13 @@
: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 @@
;; 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,11 +3774,27 @@
(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)
(mapcar 'funcall
- message-subscribed-address-functions))))
+ message-subscribed-address-functions)
+ file-regexps)))
(save-match-data
(when (eval (apply 'append '(or)
(mapcar
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: more MFT address stuff
2001-11-30 18:23 more MFT address stuff Paul Jarc
@ 2001-11-30 20:14 ` Paul Jarc
2001-12-01 2:47 ` ShengHuo ZHU
0 siblings, 1 reply; 5+ messages in thread
From: Paul Jarc @ 2001-11-30 20:14 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 124 bytes --]
I wrote:
> Here's a patch to enable support for $QMAILMFTFILE
Grr. I should test first next time. This one works.
paul
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: message.patch --]
[-- Type: text/x-patch, Size: 2093 bytes --]
Index: lisp/message.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/message.el,v
retrieving revision 6.171
diff -u -r6.171 message.el
--- lisp/message.el 2001/11/30 17:36:17 6.171
+++ lisp/message.el 2001/11/30 20:15:14
@@ -437,6 +437,13 @@
: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 @@
;; 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 @@
(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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: more MFT address stuff
2001-11-30 20:14 ` Paul Jarc
@ 2001-12-01 2:47 ` ShengHuo ZHU
2001-12-01 6:13 ` Paul Jarc
0 siblings, 1 reply; 5+ messages in thread
From: ShengHuo ZHU @ 2001-12-01 2:47 UTC (permalink / raw)
prj@po.cwru.edu (Paul Jarc) writes:
> I wrote:
>> Here's a patch to enable support for $QMAILMFTFILE
>
> Grr. I should test first next time. This one works.
Installed.
ShengHuo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: more MFT address stuff
2001-12-01 2:47 ` ShengHuo ZHU
@ 2001-12-01 6:13 ` Paul Jarc
2001-12-01 13:30 ` ShengHuo ZHU
0 siblings, 1 reply; 5+ messages in thread
From: Paul Jarc @ 2001-12-01 6:13 UTC (permalink / raw)
ShengHuo ZHU <zsh@cs.rochester.edu> wrote:
> prj@po.cwru.edu (Paul Jarc) writes:
>> Grr. I should test first next time. This one works.
>
> Installed.
I should also think a bit more. This one avoids some false positives;
the regexp was a bit off.
* message.el: fix the m-s-a-file regexp.
Index: lisp/message.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/message.el,v
retrieving revision 6.172
diff -u -r6.172 message.el
--- lisp/message.el 2001/12/01 02:49:27 6.172
+++ lisp/message.el 2001/12/01 06:07:39
@@ -3786,7 +3786,7 @@
(setq end (point))
(if (bolp) (setq end (1- end)))
(setq item (regexp-quote (buffer-substring begin end)))
- (if re (setq re (concat re "\\)\\|\\(" item))
+ (if re (setq re (concat re "\\|" item))
(setq re (concat "\\`\\(" item))))
(and re (list (concat re "\\)\\'"))))))))
(mft-regexps (apply 'append message-subscribed-regexps
paul
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: more MFT address stuff
2001-12-01 6:13 ` Paul Jarc
@ 2001-12-01 13:30 ` ShengHuo ZHU
0 siblings, 0 replies; 5+ messages in thread
From: ShengHuo ZHU @ 2001-12-01 13:30 UTC (permalink / raw)
prj@po.cwru.edu (Paul Jarc) writes:
> ShengHuo ZHU <zsh@cs.rochester.edu> wrote:
>> prj@po.cwru.edu (Paul Jarc) writes:
>>> Grr. I should test first next time. This one works.
>>
>> Installed.
>
> I should also think a bit more. This one avoids some false positives;
> the regexp was a bit off.
> * message.el: fix the m-s-a-file regexp.
Added.
ShengHuo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2001-12-01 13:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-30 18:23 more MFT address stuff Paul Jarc
2001-11-30 20:14 ` Paul Jarc
2001-12-01 2:47 ` ShengHuo ZHU
2001-12-01 6:13 ` Paul Jarc
2001-12-01 13:30 ` ShengHuo ZHU
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).