Gnus development mailing list
 help / color / mirror / Atom feed
* Reply-prefix ("Re:") default regex
       [not found] <87si7l4ndw.fsf@denknerd.org>
@ 2015-08-15 11:43 ` Paul van der Walt
  2015-08-15 15:51   ` Peter Münster
  2015-08-15 19:21   ` Steinar Bang
  0 siblings, 2 replies; 6+ messages in thread
From: Paul van der Walt @ 2015-08-15 11:43 UTC (permalink / raw)
  To: ding

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

Hello Gnus,

This is my first post to this list, so please forgive me if i break all
the written and unwritten rules.  [and my first posting hasn't showed up
after 16h, so this is potentially a double-post]

I recently ran into an issue where a French speaker i was communicating
with had "Re : ..." as their reply subject prefix (note the leading
space before the colon).  This quickly ended up with us bouncing emails
around with such lovely subject lines as "Re: Re : Re: Re : Re: ...", et
cetera, ad infinitum.  This phenomenon, of surrounding certain
punctuation marks with extra spaces, turns out to be A Thing™ in French
writing [0].  I discovered that by making a very small modification to
the term `message-subject-re-regexp`, the problem was solved for me,
locally (it's in my configuration files ATM).  But since this might be
something that's useful to others, i threw a patch together, attached.

Of course, i could understand if such cultural (non-anglophone?) cruft
were undesirable in the Gnus code base, but perhaps others might benefit
from this.  If not, i am sorry for wasting your collective time.  If the
fix is desirable yet wrong in some other way, rest assured that you all
have my deepest apologies, i don't mean to step on anyone's toes.

Thank you and have a good day,
p.

0. <http://www.btb.termiumplus.gc.ca/tcdnstyl-chap?lang=eng&lettr=chapsect17&info0=17.07>


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-message.el-message-subject-re-regexp-More-liberal-re.patch --]
[-- Type: text/x-diff, Size: 1314 bytes --]

From 62c0f7262acae856dcd43cb4fb7868c5dc1ec857 Mon Sep 17 00:00:00 2001
From: Paul van der Walt <paul@denknerd.org>
Date: Fri, 14 Aug 2015 22:27:07 +0200
Subject: [PATCH] message.el (message-subject-re-regexp): More liberal regex.

* message.el (message-subject-re-regexp): Match French style ("Re :")
reply subject prefixes.
---
 lisp/ChangeLog  | 5 +++++
 lisp/message.el | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 324f473..05d68f0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-14  Paul van der Walt  <paul@denknerd.org>
+
+	* message.el (message-subject-re-regexp): Match French style ("Re :")
+	reply subject prefixes.
+
 2015-08-06  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* message.el (message-send-form-letter): Change (message (format ...))
diff --git a/lisp/message.el b/lisp/message.el
index 26655f3..54be212 100644
--- a/lisp/message.el
+++ b/lisp/message.el
@@ -300,7 +300,7 @@ any confusion."
 		 regexp))
 
 (defcustom message-subject-re-regexp
-  "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ \t]*\\)*[ \t]*"
+  "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)* ?:[ \t]*\\)*[ \t]*"
   "*Regexp matching \"Re: \" in the subject line."
   :group 'message-various
   :link '(custom-manual "(message)Message Headers")
-- 
2.5.0


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

* Re: Reply-prefix ("Re:") default regex
  2015-08-15 11:43 ` Reply-prefix ("Re:") default regex Paul van der Walt
@ 2015-08-15 15:51   ` Peter Münster
  2015-08-15 16:48     ` [PATCH] message.el (message-subject-re-regexp): More liberal regex Paul van der Walt
  2015-08-16  3:52     ` Reply-prefix ("Re:") default regex Eric Abrahamsen
  2015-08-15 19:21   ` Steinar Bang
  1 sibling, 2 replies; 6+ messages in thread
From: Peter Münster @ 2015-08-15 15:51 UTC (permalink / raw)
  To: ding

On Sat, Aug 15 2015, Paul van der Walt wrote:

> Of course, i could understand if such cultural (non-anglophone?) cruft
> were undesirable in the Gnus code base, but perhaps others might benefit
> from this.

It's useful and I don't see any problem with that patch. Perhaps you
should repost it with a subject like "[PATCH] ..." or do M-x gnus-bug.

-- 
           Peter




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

* [PATCH] message.el (message-subject-re-regexp): More liberal regex.
  2015-08-15 15:51   ` Peter Münster
@ 2015-08-15 16:48     ` Paul van der Walt
  2016-02-07  2:52       ` Lars Ingebrigtsen
  2015-08-16  3:52     ` Reply-prefix ("Re:") default regex Eric Abrahamsen
  1 sibling, 1 reply; 6+ messages in thread
From: Paul van der Walt @ 2015-08-15 16:48 UTC (permalink / raw)
  To: ding; +Cc: Paul van der Walt

* message.el (message-subject-re-regexp): Match French style ("Re :")
reply subject prefixes.
---
 lisp/ChangeLog  | 5 +++++
 lisp/message.el | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 324f473..05d68f0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-14  Paul van der Walt  <paul@denknerd.org>
+
+	* message.el (message-subject-re-regexp): Match French style ("Re :")
+	reply subject prefixes.
+
 2015-08-06  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* message.el (message-send-form-letter): Change (message (format ...))
diff --git a/lisp/message.el b/lisp/message.el
index 26655f3..54be212 100644
--- a/lisp/message.el
+++ b/lisp/message.el
@@ -300,7 +300,7 @@ any confusion."
 		 regexp))
 
 (defcustom message-subject-re-regexp
-  "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)*:[ \t]*\\)*[ \t]*"
+  "^[ \t]*\\([Rr][Ee]\\(\\[[0-9]*\\]\\)* ?:[ \t]*\\)*[ \t]*"
   "*Regexp matching \"Re: \" in the subject line."
   :group 'message-various
   :link '(custom-manual "(message)Message Headers")
-- 
2.5.0




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

* Re: Reply-prefix ("Re:") default regex
  2015-08-15 11:43 ` Reply-prefix ("Re:") default regex Paul van der Walt
  2015-08-15 15:51   ` Peter Münster
@ 2015-08-15 19:21   ` Steinar Bang
  1 sibling, 0 replies; 6+ messages in thread
From: Steinar Bang @ 2015-08-15 19:21 UTC (permalink / raw)
  To: ding

>>>>> Paul van der Walt <paul@denknerd.org>:

> I recently ran into an issue where a French speaker i was communicating
> with had "Re : ..." as their reply subject prefix (note the leading
> space before the colon).  This quickly ended up with us bouncing emails
> around with such lovely subject lines as "Re: Re : Re: Re : Re: ...", et
> cetera, ad infinitum.  This phenomenon, of surrounding certain
> punctuation marks with extra spaces, turns out to be A Thing™ in French
> writing [0].  I discovered that by making a very small modification to
> the term `message-subject-re-regexp`, the problem was solved for me,
> locally (it's in my configuration files ATM).  But since this might be
> something that's useful to others, i threw a patch together, attached.

On a side note I have solved this outside of Gnus in procmail with this in my
.procmailrc:

#
# Fix Subject RE/SV/AW line for MSExchange/MSMail/MSOutlook
# Also fix Subject field for Norwegian android mailer ("Vedr").
# No X-Mailer field to rely on, unfortunately!
# Remove MSE quotes of type "'Real Name'"
#
:0 fhw
| /usr/bin/perl -ne "s/\?[Ww]indows-1252\?/?iso-8859-1?/g; s/^(Subject:)\s+(S[Vv]:\s*|AW:\s*|Ad:\s*|Vedr:\s*|R[eE](\(\d+\))?:\s*)+/\1 Re: /g;s/^(Subject:)\s+(=\?((iso|ISO)-8859-1|us-ascii)\?Q\?)((S[Vv]|AW|Ad|R[eE](\(\d+\))?)(:|=3[Aa])_*)+/\1 \2Re:_/g; s/\042\'([^\']*)\'\042/\042\1\042/g ; print"

As this regular expression shows there seems to be a great deal of
creativity when it comes to messing up subject headers.  Everything
matched here has been encountered in the wild.




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

* Re: Reply-prefix ("Re:") default regex
  2015-08-15 15:51   ` Peter Münster
  2015-08-15 16:48     ` [PATCH] message.el (message-subject-re-regexp): More liberal regex Paul van der Walt
@ 2015-08-16  3:52     ` Eric Abrahamsen
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2015-08-16  3:52 UTC (permalink / raw)
  To: ding

Peter Münster <pmlists@free.fr> writes:

> On Sat, Aug 15 2015, Paul van der Walt wrote:
>
>> Of course, i could understand if such cultural (non-anglophone?) cruft
>> were undesirable in the Gnus code base, but perhaps others might benefit
>> from this.
>
> It's useful and I don't see any problem with that patch. Perhaps you
> should repost it with a subject like "[PATCH] ..." or do M-x gnus-bug.

But this is already a customization option, shouldn't we just let users
customize it? Is this one tweak worth it?




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

* Re: [PATCH] message.el (message-subject-re-regexp): More liberal regex.
  2015-08-15 16:48     ` [PATCH] message.el (message-subject-re-regexp): More liberal regex Paul van der Walt
@ 2016-02-07  2:52       ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-07  2:52 UTC (permalink / raw)
  To: Paul van der Walt; +Cc: ding

Paul van der Walt <paul@denknerd.org> writes:

> * message.el (message-subject-re-regexp): Match French style ("Re :")
> reply subject prefixes.

Thanks; applied to the Emacs trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

end of thread, other threads:[~2016-02-07  2:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87si7l4ndw.fsf@denknerd.org>
2015-08-15 11:43 ` Reply-prefix ("Re:") default regex Paul van der Walt
2015-08-15 15:51   ` Peter Münster
2015-08-15 16:48     ` [PATCH] message.el (message-subject-re-regexp): More liberal regex Paul van der Walt
2016-02-07  2:52       ` Lars Ingebrigtsen
2015-08-16  3:52     ` Reply-prefix ("Re:") default regex Eric Abrahamsen
2015-08-15 19:21   ` Steinar Bang

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