Gnus development mailing list
 help / color / mirror / Atom feed
* include CC in long-to and many-to boring headers
@ 2000-01-25 15:11 David S. Goldberg
  0 siblings, 0 replies; only message in thread
From: David S. Goldberg @ 2000-01-25 15:11 UTC (permalink / raw)


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

Back in, I think, Red Gnus, I developed the long-to and many-to boring
headers.  While the horrible email system that spurred that bit of
creativity is now dead and gone, I still find some people filling up
the To header with huge lists of addresses, probably from their
personal address books.  Worse, now I'm seeing this in the Cc header.
Today was the last straw.  Someone from my Synagogue Cc'd over 500
email addresses on a 5 line message.  So I went into gnus-art.el and
modified long-to and many-to to deal with long and multiple Cc headers
as well.  My first thought was to have separate long-cc and many-cc
but I don't see how one would want to restrict display of one and not
the other.  Attached is a patch (against what I think is the latest
CVS) which I would be grateful to have committed.  Or, if people think
it'd be better to have separate long-cc and many-cc boring headers, I
can easily do that instead.

Thanks,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-art.el.fix-cc --]
[-- Type: text/x-patch, Size: 3017 bytes --]

Index: gnus-art.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v
retrieving revision 5.112
diff -c -r5.112 gnus-art.el
*** gnus-art.el	2000/01/09 15:38:15	5.112
--- gnus-art.el	2000/01/25 14:59:59
***************
*** 169,176 ****
  	      (const :tag "Followup-to identical to newsgroups." followup-to)
  	      (const :tag "Reply-to identical to from." reply-to)
  	      (const :tag "Date less than four days old." date)
! 	      (const :tag "Very long To header." long-to)
! 	      (const :tag "Multiple To headers." many-to))
    :group 'gnus-article-hiding)
  
  (defcustom gnus-signature-separator '("^-- $" "^-- *$")
--- 169,176 ----
  	      (const :tag "Followup-to identical to newsgroups." followup-to)
  	      (const :tag "Reply-to identical to from." reply-to)
  	      (const :tag "Date less than four days old." date)
! 	      (const :tag "Very long To and/or Cc header." long-to)
! 	      (const :tag "Multiple To and/or Cc headers." many-to))
    :group 'gnus-article-hiding)
  
  (defcustom gnus-signature-separator '("^-- $" "^-- *$")
***************
*** 1168,1178 ****
  			      4))
  		  (gnus-article-hide-header "date"))))
  	     ((eq elem 'long-to)
! 	      (let ((to (message-fetch-field "to")))
  		(when (> (length to) 1024)
! 		  (gnus-article-hide-header "to"))))
  	     ((eq elem 'many-to)
! 	      (let ((to-count 0))
  		(goto-char (point-min))
  		(while (re-search-forward "^to:" nil t)
  		  (setq to-count (1+ to-count)))
--- 1168,1182 ----
  			      4))
  		  (gnus-article-hide-header "date"))))
  	     ((eq elem 'long-to)
! 	      (let ((to (message-fetch-field "to"))
! 		    (cc (message-fetch-field "cc")))
  		(when (> (length to) 1024)
! 		  (gnus-article-hide-header "to"))
! 		(when (> (length cc) 1024)
! 		  (gnus-article-hide-header "cc"))))
  	     ((eq elem 'many-to)
! 	      (let ((to-count 0)
! 		    (cc-count 0))
  		(goto-char (point-min))
  		(while (re-search-forward "^to:" nil t)
  		  (setq to-count (1+ to-count)))
***************
*** 1184,1190 ****
  		      (forward-line -1)
  		      (narrow-to-region (point) (point-max))
  		      (gnus-article-hide-header "to"))
! 		    (setq to-count (1- to-count)))))))))))))
  
  (defun gnus-article-hide-header (header)
    (save-excursion
--- 1188,1206 ----
  		      (forward-line -1)
  		      (narrow-to-region (point) (point-max))
  		      (gnus-article-hide-header "to"))
! 		    (setq to-count (1- to-count))))
! 		(goto-char (point-min))
! 		(while (re-search-forward "^cc:" nil t)
! 		  (setq cc-count (1+ cc-count)))
! 		(when (> cc-count 1)
! 		  (while (> cc-count 0)
! 		    (goto-char (point-min))
! 		    (save-restriction
! 		      (re-search-forward "^cc:" nil nil cc-count)
! 		      (forward-line -1)
! 		      (narrow-to-region (point) (point-max))
! 		      (gnus-article-hide-header "cc"))
! 		    (setq cc-count (1- cc-count)))))))))))))
  
  (defun gnus-article-hide-header (header)
    (save-excursion

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


-- 
Dave Goldberg
Post: The Mitre Corporation\MS B325\202 Burlington Rd.\Bedford, MA 01730
Phone: 781-271-3887
Email: dsg@mitre.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-01-25 15:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-25 15:11 include CC in long-to and many-to boring headers David S. Goldberg

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