Gnus development mailing list
 help / color / mirror / Atom feed
* split banners of free mail servers
@ 2002-09-11  4:47 tsuchiya
  2002-09-11  5:18 ` Katsumi Yamaoka
  2002-09-24  9:40 ` TSUCHIYA Masatoshi
  0 siblings, 2 replies; 6+ messages in thread
From: tsuchiya @ 2002-09-11  4:47 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-09-24  9:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-11  4:47 split banners of free mail servers tsuchiya
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

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).