Gnus development mailing list
 help / color / mirror / Atom feed
From: tsuchiya@namazu.org
Subject: split banners of free mail servers
Date: Wed, 11 Sep 2002 13:47:45 +0900	[thread overview]
Message-ID: <almk4k$vka$1@quimby.gnus.org> (raw)

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

Hello, Gnus developers.

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.

2002-09-11  TSUCHIYA Masatoshi  <tsuchiya@namazu.org>

        * gnus-art.el (gnus-article-address-banner-alist): New option.
        (article-strip-banner): Refer the above option to split
        banners of free mail servers, when no group parameter is
        specified.


[-- Attachment #2: Type: text/plain, Size: 1505 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 05:17:51
@@ -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,15 @@
 	    (banner (gnus-parameter-banner gnus-newsgroup-name))
 	    (gnus-signature-limit nil)
 	    buffer-read-only beg end)
+	(unless banner
+	  (setq banner
+		(assoc-default (save-restriction
+				 (widen)
+				 (article-narrow-to-head)
+				 (caar (mail-header-parse-addresses
+					(mail-fetch-field "from"))))
+			       gnus-article-address-banner-alist
+			       'string-match)))
 	(when banner
 	  (article-goto-body)
 	  (cond

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

-- 
TSUCHIYA Masatoshi

             reply	other threads:[~2002-09-11  4:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-11  4:47 tsuchiya [this message]
2002-09-11  5:18 ` Katsumi Yamaoka
2002-09-11  5:30   ` tsuchiya
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='almk4k$vka$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).