Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH] Use `banner' group parameter in addition to gnus-article-address-banner-alist
@ 2002-12-31  6:43 Michael Shields
  2003-01-01 18:58 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Shields @ 2002-12-31  6:43 UTC (permalink / raw)


I sent this patch a few days ago, but mail.gnus.org ate it.

Currently Gnus ignores gnus-article-address-banner-alist if there is a
`banner' group parameter.  This is not what the documentation says,
and I think it is better here to change the code instead of the manual.

2002-12-21  Michael Shields  <shields@msrl.com>

	* gnus-art.el (article-strip-banner): Always pay attention to
	gnus-article-address-banner-alist, even if there is no `banner'
	group parameter.
	(article-really-strip-banner): New function.

--- /home/shields/gnus-CURRENT-20021216/lisp/gnus-art.el.orig	2002-12-31 06:42:11.000000000 +0000
+++ /home/shields/gnus-CURRENT-20021216/lisp/gnus-art.el	2002-12-31 06:42:11.000000000 +0000
@@ -2320,43 +2320,50 @@
 	     (match-beginning 0) (match-end 0) 'pem)))))))
 
 (defun article-strip-banner ()
-  "Strip the banner specified by the `banner' group parameter."
+  "Strip the banners specified by the `banner' group parameter and by
+`gnus-article-address-banner-alist'."
   (interactive)
   (save-excursion
     (save-restriction
+      (let ((inhibit-point-motion-hooks t))
+	(when (gnus-parameter-banner gnus-newsgroup-name)
+	  (article-really-strip-banner
+	   (gnus-parameter-banner gnus-newsgroup-name)))
+	(when gnus-article-address-banner-alist
+	  (article-really-strip-banner
+	   (let ((from (save-restriction
+			 (widen)
+			 (article-narrow-to-head)
+			 (mail-fetch-field "from"))))
+	     (when (and from
+			(setq from
+			      (caar (mail-header-parse-addresses from))))
+	       (catch 'found
+		 (dolist (pair gnus-article-address-banner-alist)
+		   (when (string-match (car pair) from)
+		     (throw 'found (cdr pair)))))))))))))
+
+(defun article-really-strip-banner (banner)
+  "Strip the banner specified by the argument."
+  (save-excursion
+    (save-restriction
       (let ((inhibit-point-motion-hooks t)
-	    (banner (gnus-parameter-banner gnus-newsgroup-name))
 	    (gnus-signature-limit nil)
-	    buffer-read-only beg end)
-	(when (and gnus-article-address-banner-alist
-		   (not banner))
-	  (setq banner
-		(let ((from (save-restriction
-			      (widen)
-			      (article-narrow-to-head)
-			      (mail-fetch-field "from"))))
-		  (when (and from
-			     (setq from
-				   (caar (mail-header-parse-addresses 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
-	   ((eq banner 'signature)
-	    (when (gnus-article-narrow-to-signature)
-	      (widen)
-	      (forward-line -1)
-	      (delete-region (point) (point-max))))
-	   ((symbolp banner)
-	    (if (setq banner (cdr (assq banner gnus-article-banner-alist)))
-		(while (re-search-forward banner nil t)
-		  (delete-region (match-beginning 0) (match-end 0)))))
-	   ((stringp banner)
-	    (while (re-search-forward banner nil t)
-	      (delete-region (match-beginning 0) (match-end 0))))))))))
+	    buffer-read-only)
+	(article-goto-body)
+	(cond
+	 ((eq banner 'signature)
+	  (when (gnus-article-narrow-to-signature)
+	    (widen)
+	    (forward-line -1)
+	    (delete-region (point) (point-max))))
+	 ((symbolp banner)
+	  (if (setq banner (cdr (assq banner gnus-article-banner-alist)))
+	      (while (re-search-forward banner nil t)
+		(delete-region (match-beginning 0) (match-end 0)))))
+	 ((stringp banner)
+	  (while (re-search-forward banner nil t)
+	    (delete-region (match-beginning 0) (match-end 0)))))))))
 
 (defun article-babel ()
   "Translate article using an online translation service."

-- 
Shields.




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

* Re: [PATCH] Use `banner' group parameter in addition to gnus-article-address-banner-alist
  2002-12-31  6:43 [PATCH] Use `banner' group parameter in addition to gnus-article-address-banner-alist Michael Shields
@ 2003-01-01 18:58 ` Lars Magne Ingebrigtsen
  2003-01-01 19:59   ` Kai Großjohann
  2003-01-01 21:53   ` Michael Shields
  0 siblings, 2 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-01 18:58 UTC (permalink / raw)


Michael Shields <shields@msrl.com> writes:

> 	* gnus-art.el (article-strip-banner): Always pay attention to
> 	gnus-article-address-banner-alist, even if there is no `banner'
> 	group parameter.
> 	(article-really-strip-banner): New function.

Thanks.  This patch is so big that we need FSF copyright paperwork,
though.  Have you done a copyright assignment before?

(I used to be able to remember who had, but it's been a while, so
I've mostly forgotten.  Is there a file somewhere that shows who's on,
er, file with copyright assignments?  That'd help a lot...)

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: [PATCH] Use `banner' group parameter in addition to gnus-article-address-banner-alist
  2003-01-01 18:58 ` Lars Magne Ingebrigtsen
@ 2003-01-01 19:59   ` Kai Großjohann
  2003-01-01 20:03     ` Lars Magne Ingebrigtsen
  2003-01-01 21:53   ` Michael Shields
  1 sibling, 1 reply; 6+ messages in thread
From: Kai Großjohann @ 2003-01-01 19:59 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> (I used to be able to remember who had, but it's been a while, so
> I've mostly forgotten.  Is there a file somewhere that shows who's on,
> er, file with copyright assignments?  That'd help a lot...)

/gd/gnuorg/copyright.list on fencepost.  I used to be able to look,
but I can't log in anymore...
-- 
Ambibibentists unite!



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

* Re: [PATCH] Use `banner' group parameter in addition to gnus-article-address-banner-alist
  2003-01-01 19:59   ` Kai Großjohann
@ 2003-01-01 20:03     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-01 20:03 UTC (permalink / raw)


kai.grossjohann@uni-duisburg.de (Kai Großjohann) writes:

> /gd/gnuorg/copyright.list on fencepost.  I used to be able to look,
> but I can't log in anymore...

I forgot my password a couple of years back.  :-/

Can somebody with access mail it to me?

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: [PATCH] Use `banner' group parameter in addition to gnus-article-address-banner-alist
  2003-01-01 18:58 ` Lars Magne Ingebrigtsen
  2003-01-01 19:59   ` Kai Großjohann
@ 2003-01-01 21:53   ` Michael Shields
  2003-01-01 22:10     ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 6+ messages in thread
From: Michael Shields @ 2003-01-01 21:53 UTC (permalink / raw)


In article <m34r8s3dep.fsf@quimbies.gnus.org>,
Lars Magne Ingebrigtsen <larsi@gnus.org> wrote:
> Thanks.  This patch is so big that we need FSF copyright paperwork,
> though.  Have you done a copyright assignment before?

No, I haven't yet.  Did you find out what the procedure was?
-- 
Shields.




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

* Re: [PATCH] Use `banner' group parameter in addition to gnus-article-address-banner-alist
  2003-01-01 21:53   ` Michael Shields
@ 2003-01-01 22:10     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-01 22:10 UTC (permalink / raw)


Michael Shields <shields@msrl.com> writes:

> No, I haven't yet.  Did you find out what the procedure was?

Yup.  I'll mail you the form...

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

end of thread, other threads:[~2003-01-01 22:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-31  6:43 [PATCH] Use `banner' group parameter in addition to gnus-article-address-banner-alist Michael Shields
2003-01-01 18:58 ` Lars Magne Ingebrigtsen
2003-01-01 19:59   ` Kai Großjohann
2003-01-01 20:03     ` Lars Magne Ingebrigtsen
2003-01-01 21:53   ` Michael Shields
2003-01-01 22:10     ` Lars Magne Ingebrigtsen

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