* [PATCH] Better handling for Microsoft citations (resend)
@ 2003-02-12 18:03 Michael Shields
2003-02-12 20:25 ` Kai Großjohann
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Michael Shields @ 2003-02-12 18:03 UTC (permalink / raw)
Resending since I now have papers on file.
2003-02-13 Michael Shields <shields@msrl.com>
* gnus-cite.el
(gnus-cite-attribution-suffix, gnus-cite-parse):
Better handling for Microsoft citation styles.
(gnus-unsightly-citation-regexp): New.
Index: lisp/gnus-cite.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-cite.el,v
retrieving revision 6.21
diff -u -r6.21 gnus-cite.el
--- lisp/gnus-cite.el 12 Feb 2003 15:06:16 -0000 6.21
+++ lisp/gnus-cite.el 12 Feb 2003 18:03:16 -0000
@@ -90,19 +90,42 @@
:group 'gnus-cite
:type 'integer)
+;; Some Microsoft products put in a citation that extends to the
+;; remainder of the message:
+;;
+;; -----Original Message-----
+;; From: ...
+;; To: ...
+;; Sent: ... [date, in non-RFC-2822 format]
+;; Subject: ...
+;;
+;; Cited message, with no prefixes
+;;
+;; The four headers are always the same. But note they are prone to
+;; folding without additional indentation.
+;;
+;; Others use "----- Original Message -----" instead, and properly quote
+;; the body using "> ". This style is handled without special cases.
+
(defcustom gnus-cite-attribution-prefix
- "In article\\|in <\\|On \\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),\\|-----Original Message-----"
+ "In article\\|in <\\|On \\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\),\\|----- ?Original Message ?-----"
"*Regexp matching the beginning of an attribution line."
:group 'gnus-cite
:type 'regexp)
(defcustom gnus-cite-attribution-suffix
- "\\(\\(wrote\\|writes\\|said\\|says\\|>\\)\\(:\\|\\.\\.\\.\\)\\|-----Original Message-----\\)[ \t]*$"
+ "\\(\\(wrote\\|writes\\|said\\|says\\|>\\)\\(:\\|\\.\\.\\.\\)\\|----- ?Original Message ?-----\\)[ \t]*$"
"*Regexp matching the end of an attribution line.
The text matching the first grouping will be used as a button."
:group 'gnus-cite
:type 'regexp)
+(defcustom gnus-unsightly-citation-regexp
+ "^-----Original Message-----\nFrom: \\(.+\n\\)+\n"
+ "Regexp matching Microsoft-type rest-of-message citations."
+ :group 'gnus-cite
+ :type 'regexp)
+
(defface gnus-cite-attribution-face '((t
(:italic t)))
"Face used for attribution lines.")
@@ -724,9 +747,19 @@
(goto-char begin))
(goto-char start)
(setq line (1+ line)))
+ ;; Horrible special case for some Microsoft mailers.
+ (goto-char (point-min))
+ (when (re-search-forward gnus-unsightly-citation-regexp max t)
+ (setq begin (count-lines (point-min) (point)))
+ (setq end (count-lines (point-min) max))
+ (setq entry nil)
+ (while (< begin end)
+ (push begin entry)
+ (setq begin (1+ begin)))
+ (push (cons "" entry) alist))
;; We got all the potential prefixes. Now create
;; `gnus-cite-prefix-alist' containing the oldest prefix for each
- ;; line that appears at least gnus-cite-minimum-match-count
+ ;; line that appears at least `gnus-cite-minimum-match-count'
;; times. First sort them by length. Longer is older.
(setq alist (sort alist (lambda (a b)
(> (length (car a)) (length (car b))))))
--
Shields.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Better handling for Microsoft citations (resend)
2003-02-12 18:03 [PATCH] Better handling for Microsoft citations (resend) Michael Shields
@ 2003-02-12 20:25 ` Kai Großjohann
2003-02-12 20:27 ` Kai Großjohann
2003-02-12 22:30 ` Reiner Steib
2 siblings, 0 replies; 9+ messages in thread
From: Kai Großjohann @ 2003-02-12 20:25 UTC (permalink / raw)
Committed.
--
A turnip curses Elvis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Better handling for Microsoft citations (resend)
2003-02-12 18:03 [PATCH] Better handling for Microsoft citations (resend) Michael Shields
2003-02-12 20:25 ` Kai Großjohann
@ 2003-02-12 20:27 ` Kai Großjohann
2003-02-12 23:41 ` Michael Shields
2003-02-12 22:30 ` Reiner Steib
2 siblings, 1 reply; 9+ messages in thread
From: Kai Großjohann @ 2003-02-12 20:27 UTC (permalink / raw)
Michael Shields <shields@msrl.com> writes:
> 2003-02-13 Michael Shields <shields@msrl.com>
>
> * gnus-cite.el
> (gnus-cite-attribution-suffix, gnus-cite-parse):
> Better handling for Microsoft citation styles.
> (gnus-unsightly-citation-regexp): New.
Seems like it's worth a line in GNUS-NEWS.
--
A turnip curses Elvis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Better handling for Microsoft citations (resend)
2003-02-12 18:03 [PATCH] Better handling for Microsoft citations (resend) Michael Shields
2003-02-12 20:25 ` Kai Großjohann
2003-02-12 20:27 ` Kai Großjohann
@ 2003-02-12 22:30 ` Reiner Steib
2003-02-13 11:30 ` Kai Großjohann
2 siblings, 1 reply; 9+ messages in thread
From: Reiner Steib @ 2003-02-12 22:30 UTC (permalink / raw)
On Wed, Feb 12 2003, Michael Shields wrote:
> +(defcustom gnus-unsightly-citation-regexp
> + "^-----Original Message-----\nFrom: \\(.+\n\\)+\n"
> + "Regexp matching Microsoft-type rest-of-message citations."
> + :group 'gnus-cite
> + :type 'regexp)
Wouldn't it be better to use a name starting with `gnus-cite-' for
consistency?
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Better handling for Microsoft citations (resend)
2003-02-12 20:27 ` Kai Großjohann
@ 2003-02-12 23:41 ` Michael Shields
2003-02-13 11:29 ` Kai Großjohann
0 siblings, 1 reply; 9+ messages in thread
From: Michael Shields @ 2003-02-12 23:41 UTC (permalink / raw)
Cc: ding
In article <84smutgs8b.fsf@lucy.is.informatik.uni-duisburg.de>,
kai.grossjohann@uni-duisburg.de (Kai Großjohann) wrote:
> Seems like it's worth a line in GNUS-NEWS.
** Better handling of Microsoft citation styles
Gnus now tries to recognize the mangled header block that some
Microsoft mailers use to indicate that the rest of the message is a
citation, even though it is not quoted in any way. The variable
`gnus-unsightly-citation-regexp' matches the start of these citations.
--
Shields.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Better handling for Microsoft citations (resend)
2003-02-12 23:41 ` Michael Shields
@ 2003-02-13 11:29 ` Kai Großjohann
0 siblings, 0 replies; 9+ messages in thread
From: Kai Großjohann @ 2003-02-13 11:29 UTC (permalink / raw)
Committing.
--
A turnip curses Elvis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Better handling for Microsoft citations (resend)
2003-02-12 22:30 ` Reiner Steib
@ 2003-02-13 11:30 ` Kai Großjohann
2003-02-19 18:00 ` Reiner Steib
0 siblings, 1 reply; 9+ messages in thread
From: Kai Großjohann @ 2003-02-13 11:30 UTC (permalink / raw)
Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:
> On Wed, Feb 12 2003, Michael Shields wrote:
>
>> +(defcustom gnus-unsightly-citation-regexp
>> + "^-----Original Message-----\nFrom: \\(.+\n\\)+\n"
>> + "Regexp matching Microsoft-type rest-of-message citations."
>> + :group 'gnus-cite
>> + :type 'regexp)
>
> Wouldn't it be better to use a name starting with `gnus-cite-' for
> consistency?
I agree. Michael, what do you think?
--
A turnip curses Elvis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Better handling for Microsoft citations (resend)
2003-02-13 11:30 ` Kai Großjohann
@ 2003-02-19 18:00 ` Reiner Steib
2003-02-19 19:08 ` Kai Großjohann
0 siblings, 1 reply; 9+ messages in thread
From: Reiner Steib @ 2003-02-19 18:00 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1115 bytes --]
On Thu, Feb 13 2003, Kai Großjohann wrote:
> Reiner Steib <4.uce.03.r.s@nurfuerspam.de> writes:
>
>> On Wed, Feb 12 2003, Michael Shields wrote:
>>
>>> +(defcustom gnus-unsightly-citation-regexp
>>> + "^-----Original Message-----\nFrom: \\(.+\n\\)+\n"
>>> + "Regexp matching Microsoft-type rest-of-message citations."
[...]
>> Wouldn't it be better to use a name starting with `gnus-cite-' for
>> consistency?
>
> I agree. Michael, what do you think?
No response or objection from Michael?
I propose to rename it and apply the attached patch (patch to
ChangeLog files is also included):
--8<---------------cut here---------------start------------->8---
2003-02-19 Reiner Steib <Reiner.Steib@gmx.de>
* GNUS-NEWS: Renamed `gnus-unsightly-citation-regexp' to
`gnus-cite-unsightly-citation-regexp'.
2003-02-19 Reiner Steib <Reiner.Steib@gmx.de>
* gnus-cite.el (gnus-cite-unsightly-citation-regexp)
(gnus-cite-parse): Renamed `gnus-unsightly-citation-regexp' to
`gnus-cite-unsightly-citation-regexp'.
--8<---------------cut here---------------end--------------->8---
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-cite.unsightly.patch --]
[-- Type: text/x-patch, Size: 3087 bytes --]
Index: GNUS-NEWS
===================================================================
RCS file: /usr/local/cvsroot/gnus/GNUS-NEWS,v
retrieving revision 6.43
diff -u -r6.43 GNUS-NEWS
--- GNUS-NEWS 18 Feb 2003 20:42:51 -0000 6.43
+++ GNUS-NEWS 19 Feb 2003 18:06:58 -0000
@@ -10,10 +10,11 @@
** Better handling of Microsoft citation styles
-Gnus now tries to recognize the mangled header block that some
-Microsoft mailers use to indicate that the rest of the message is a
-citation, even though it is not quoted in any way. The variable
-`gnus-unsightly-citation-regexp' matches the start of these citations.
+Gnus now tries to recognize the mangled header block that some Microsoft
+mailers use to indicate that the rest of the message is a citation, even
+though it is not quoted in any way. The variable
+`gnus-cite-unsightly-citation-regexp' matches the start of these
+citations.
** gnus-article-skip-boring
Index: ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/ChangeLog,v
retrieving revision 6.44
diff -u -r6.44 ChangeLog
--- ChangeLog 18 Feb 2003 20:43:17 -0000 6.44
+++ ChangeLog 19 Feb 2003 18:06:58 -0000
@@ -1,3 +1,8 @@
+2003-02-19 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * GNUS-NEWS: Renamed `gnus-unsightly-citation-regexp' to
+ `gnus-cite-unsightly-citation-regexp'.
+
2003-02-18 Simon Josefsson <jas@extundo.com>
* GNUS-NEWS: Talk about canlock more.
Index: lisp/gnus-cite.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-cite.el,v
retrieving revision 6.22
diff -u -r6.22 gnus-cite.el
--- lisp/gnus-cite.el 12 Feb 2003 20:36:45 -0000 6.22
+++ lisp/gnus-cite.el 19 Feb 2003 18:06:58 -0000
@@ -120,7 +120,7 @@
:group 'gnus-cite
:type 'regexp)
-(defcustom gnus-unsightly-citation-regexp
+(defcustom gnus-cite-unsightly-citation-regexp
"^-----Original Message-----\nFrom: \\(.+\n\\)+\n"
"Regexp matching Microsoft-type rest-of-message citations."
:group 'gnus-cite
@@ -749,7 +749,7 @@
(setq line (1+ line)))
;; Horrible special case for some Microsoft mailers.
(goto-char (point-min))
- (when (re-search-forward gnus-unsightly-citation-regexp max t)
+ (when (re-search-forward gnus-cite-unsightly-citation-regexp max t)
(setq begin (count-lines (point-min) (point)))
(setq end (count-lines (point-min) max))
(setq entry nil)
Index: lisp/ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v
retrieving revision 6.2014
diff -u -r6.2014 ChangeLog
--- lisp/ChangeLog 19 Feb 2003 06:55:27 -0000 6.2014
+++ lisp/ChangeLog 19 Feb 2003 18:06:59 -0000
@@ -1,3 +1,9 @@
+2003-02-19 Reiner Steib <Reiner.Steib@gmx.de>
+
+ * gnus-cite.el (gnus-cite-unsightly-citation-regexp)
+ (gnus-cite-parse): Renamed `gnus-unsightly-citation-regexp' to
+ `gnus-cite-unsightly-citation-regexp'.
+
2003-02-19 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-msg.el (gnus-copy-article-buffer): Copy an article header
[-- Attachment #3: Type: text/plain, Size: 116 bytes --]
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Better handling for Microsoft citations (resend)
2003-02-19 18:00 ` Reiner Steib
@ 2003-02-19 19:08 ` Kai Großjohann
0 siblings, 0 replies; 9+ messages in thread
From: Kai Großjohann @ 2003-02-19 19:08 UTC (permalink / raw)
Committed.
--
A turnip curses Elvis
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-02-19 19:08 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-12 18:03 [PATCH] Better handling for Microsoft citations (resend) Michael Shields
2003-02-12 20:25 ` Kai Großjohann
2003-02-12 20:27 ` Kai Großjohann
2003-02-12 23:41 ` Michael Shields
2003-02-13 11:29 ` Kai Großjohann
2003-02-12 22:30 ` Reiner Steib
2003-02-13 11:30 ` Kai Großjohann
2003-02-19 18:00 ` Reiner Steib
2003-02-19 19:08 ` Kai Großjohann
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).