Gnus development mailing list
 help / color / mirror / Atom feed
From: Karl Kleinpaste <karl@charcoal.com>
Subject: Eliminating repetitious "Re: Re: Re: ..."
Date: 31 Jan 2001 09:31:42 -0500	[thread overview]
Message-ID: <vxk1ytjg5dd.fsf@cinnamon.vanillaknot.com> (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."

             reply	other threads:[~2001-01-31 14:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-31 14:31 Karl Kleinpaste [this message]
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

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=vxk1ytjg5dd.fsf@cinnamon.vanillaknot.com \
    --to=karl@charcoal.com \
    /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).