Gnus development mailing list
 help / color / mirror / Atom feed
From: tsuchiya@namazu.org
Subject: Re: split banners of free mail servers
Date: Wed, 11 Sep 2002 14:30:59 +0900	[thread overview]
Message-ID: <almmlm$463$1@quimby.gnus.org> (raw)
In-Reply-To: <yotlsn0hgl4i.fsf@jpl.org>

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

>> On Wed, 11 Sep 2002 14:18:05 +0900
>> yamaoka@jpl.org (Katsumi Yamaoka) said as follows:

>> Some mail servers, which provide free mail accounts, insert their
>> advertisements into their relaying messages.  In order to split
>> them, I propose the following change.

>That's a good feature.  But...

>> +		(assoc-default (save-restriction

>I noticed just now that the function `assoc-default' is not available
>in XEmacs without APEL.

I see.  Here is the revised patch.


[-- Attachment #2: Type: text/plain, Size: 1604 bytes --]

Index: gnus-art.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v
retrieving revision 6.231
diff -u -u -r6.231 gnus-art.el
--- gnus-art.el	2002/09/09 15:24:16	6.231
+++ gnus-art.el	2002/09/11 06:03:52
@@ -279,6 +279,21 @@
 A string is used as a regular expression to match the banner
 directly.")
 
+(defcustom gnus-article-address-banner-alist nil
+  "*Banner alist for free mail addresses.
+For example,
+     ((\"@yahoo\\.co\\.jp\\\\'\" . \"\\n_+\\nDo You Yahoo!\\\\?\\n.*\\n.*\\n\"))
+"
+  :type '(repeat
+	  (cons
+	   (regexp :tag "Address")
+	   (choice :tag "Banner" :value nil
+		   (const :tag "Remove signature" signature)
+		   (symbol :tag "Item in `gnus-article-banner-alist'" none)
+		   regexp
+		   (const :tag "None" nil))))
+  :group 'gnus-article-washing)
+
 (defcustom gnus-emphasis-alist
   (let ((format
 	 "\\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\([-,.;:!?\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)")
@@ -2252,6 +2267,17 @@
 	    (banner (gnus-parameter-banner gnus-newsgroup-name))
 	    (gnus-signature-limit nil)
 	    buffer-read-only beg end)
+	(unless banner
+	  (setq banner
+		(let ((from (save-restriction
+			      (widen)
+			      (article-narrow-to-head)
+			      (caar (mail-header-parse-addresses
+				     (mail-fetch-field "from"))))))
+		  (catch 'found
+		    (dolist (pair gnus-article-address-banner-alist)
+		      (when (string-match (car pair) from)
+			(throw 'found (cdr pair))))))))
 	(when banner
 	  (article-goto-body)
 	  (cond

[-- Attachment #3: Type: text/plain, Size: 23 bytes --]

-- 
TSUCHIYA Masatoshi

  reply	other threads:[~2002-09-11  5:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-11  4:47 tsuchiya
2002-09-11  5:18 ` Katsumi Yamaoka
2002-09-11  5:30   ` tsuchiya [this message]
2002-09-11  5:48     ` Katsumi Yamaoka
2002-09-24  9:40 ` TSUCHIYA Masatoshi
2002-09-24  9:59   ` Katsumi Yamaoka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='almmlm$463$1@quimby.gnus.org' \
    --to=tsuchiya@namazu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).