Gnus development mailing list
 help / color / mirror / Atom feed
* Eliminating repetitious "Re: Re: Re: ..."
@ 2001-01-31 14:31 Karl Kleinpaste
  2001-01-31 15:41 ` Oyvind Moll
  2001-01-31 18:07 ` ShengHuo ZHU
  0 siblings, 2 replies; 6+ messages in thread
From: Karl Kleinpaste @ 2001-01-31 14:31 UTC (permalink / raw)


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

I want to repair this damage done to Subject lines, notably in mailing
lists which have standard tokens in them.

For example, and as I'm sure everyone knows, you get a mailing list
which automatically prepends "[foo]" to every subject line if it is
not already present:
    Subject: [foo] the original subject
Normal followups to this, in the absence of other hackery, become:
    Subject: Re: [foo] the original subject
Egroups and related list-support sites will leave this one alone,
because the needed "[foo]" token is in place.  But then we Gnusers
come along, knowing that we don't need no steenkin' subject tokens,
and so we strip them out:
    (setq nnmail-list-identifiers '("\\[foo]"))
so that what we see is:
    Subject: the original subject
and when we reply, we generate:
    Subject: Re: the original subject
List handlers decide this is inadequate, so they re-append the token:
    Subject: [foo] Re: the original subject
and then some non-Gnuser follows up, generating
    Subject: Re: [foo] Re: the original subject
which the list-identifier-stripping Gnuser will subsequently see as:
    Subject: Re: Re: the original subject

The patch below addresses this during nnmail-list-identifiers
processing, detecting repeated occurrence of "Re: " and reducing it to
just one.

--karl

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnmail.el diff, removing excess \"Re: \" --]
[-- Type: text/x-patch, Size: 690 bytes --]

--- lisp/nnmail.el.~1~	Tue Jan 23 09:12:11 2001
+++ lisp/nnmail.el	Wed Jan 31 09:30:30 2001
@@ -1097,9 +1097,12 @@
     (when regexp
       (goto-char (point-min))
       (when (re-search-forward
-	     (concat "^Subject: +\\(Re: +\\)?\\(" regexp " *\\)")
+	     (concat "^Subject: +\\(R[Ee]: +\\)?\\(" regexp " *\\)")
 	     nil t)
-	(delete-region (match-beginning 2) (match-end 0))))))
+	(delete-region (match-beginning 2) (match-end 0)))
+      (goto-char (point-min))
+      (when (re-search-forward "^Subject: +\\(R[Ee]: +\\)+R[Ee]: +" nil t)
+	(delete-region (match-beginning 1) (match-end 1))))))
 
 (defun nnmail-remove-tabs ()
   "Translate TAB characters into SPACE characters."

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

end of thread, other threads:[~2001-02-02 21:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-31 14:31 Eliminating repetitious "Re: Re: Re: ..." Karl Kleinpaste
2001-01-31 15:41 ` Oyvind Moll
2001-01-31 18:07 ` ShengHuo ZHU
2001-01-31 19:57   ` Karl Kleinpaste
2001-01-31 20:55     ` ShengHuo ZHU
2001-02-02 21:22   ` Paul Jarc

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