Gnus development mailing list
 help / color / mirror / Atom feed
* suggestion: don't treat ">From " as quote
@ 2004-06-20 19:13 Karl Chen
  2004-06-21 10:12 ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Karl Chen @ 2004-06-20 19:13 UTC (permalink / raw)



If a line in text starts with "from ", then the mailer
automatically changes it to ">from ".  Gnus treats this as quoted
text.  It's more annoying when it's automatically hidden.  Perhaps
this can be fixed (optionally).


-- 
Karl 2004-06-20 12:12




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

* Re: suggestion: don't treat ">From " as quote
  2004-06-20 19:13 suggestion: don't treat ">From " as quote Karl Chen
@ 2004-06-21 10:12 ` Katsumi Yamaoka
  2004-06-22  8:23   ` Karl Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2004-06-21 10:12 UTC (permalink / raw)


>>>>> In <quack.20040620T1213.j54qp6qbzf@hkn.eecs.berkeley.edu>
>>>>>	Karl Chen <quarl@nospam.quarl.org> wrote:

> If a line in text starts with "from ", then the mailer
> automatically changes it to ">from ".  Gnus treats this as quoted
> text.  It's more annoying when it's automatically hidden.  Perhaps
> this can be fixed (optionally).

Isn't it enough for the purpose?

(push '("^\\([Ff][Rr][Oo][Mm]\\) " 1 'mode-line)
      message-font-lock-keywords)
-- 
From :-p Katsumi Yamaoka <yamaoka@jpl.org> 



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

* Re: suggestion: don't treat ">From " as quote
  2004-06-21 10:12 ` Katsumi Yamaoka
@ 2004-06-22  8:23   ` Karl Chen
  2004-06-22 11:31     ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Karl Chen @ 2004-06-22  8:23 UTC (permalink / raw)


>>>>> "Katsumi" == Katsumi Yamaoka <yamaoka@jpl.org> writes:
    Katsumi> (push '("^\\([Ff][Rr][Oo][Mm]\\) " 1 'mode-line)
    Katsumi>       message-font-lock-keywords)

Nope, doesn't work :(

The color is still citation color, but more importantly, I have
`gnus-cite-hide-percentage' and `gnus-cite-hide-absolute' set so
they are still hidden.

The only change seems to be when /typing/ messages, not reading
articles.


-- 
Karl 2004-06-22 01:20




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

* Re: suggestion: don't treat ">From " as quote
  2004-06-22  8:23   ` Karl Chen
@ 2004-06-22 11:31     ` Katsumi Yamaoka
  2004-06-23  9:14       ` Karl Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2004-06-22 11:31 UTC (permalink / raw)


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

>>>>> In <quack.20040622T0123.j5fz8oq9vt@hkn.eecs.berkeley.edu>
>>>>>	Karl Chen <quarl@nospam.quarl.org> wrote:

>     Katsumi> (push '("^\\([Ff][Rr][Oo][Mm]\\) " 1 'mode-line)
>     Katsumi>       message-font-lock-keywords)

> Nope, doesn't work :(

> The color is still citation color, but more importantly, I have
> `gnus-cite-hide-percentage' and `gnus-cite-hide-absolute' set so
> they are still hidden.

> The only change seems to be when /typing/ messages, not reading
> articles.

I probably saw what should be improved.  How about the following
patch?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 986 bytes --]

--- gnus-5.10.6/lisp/gnus-cite.el~	2003-05-10 20:58:01 +0000
+++ gnus-5.10.6/lisp/gnus-cite.el	2004-06-22 11:27:41 +0000
@@ -741,13 +741,16 @@
 	(setq end (+ begin gnus-cite-max-prefix)))
       (while (re-search-forward prefix-regexp (1- end) t)
 	;; Each prefix.
-	(setq end (match-end 0)
-	      prefix (buffer-substring begin end))
-	(gnus-set-text-properties 0 (length prefix) nil prefix)
-	(setq entry (assoc prefix alist))
-	(if entry
-	    (setcdr entry (cons line (cdr entry)))
-	  (push (list prefix line) alist))
+	(setq end (match-end 0))
+	(unless (string-match "\\`>from "
+			      (buffer-substring (gnus-point-at-bol)
+						(gnus-point-at-eol)))
+	  (setq prefix (buffer-substring begin end))
+	  (gnus-set-text-properties 0 (length prefix) nil prefix)
+	  (setq entry (assoc prefix alist))
+	  (if entry
+	      (setcdr entry (cons line (cdr entry)))
+	    (push (list prefix line) alist)))
 	(goto-char begin))
       (goto-char start)
       (setq line (1+ line)))

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

* Re: suggestion: don't treat ">From " as quote
  2004-06-22 11:31     ` Katsumi Yamaoka
@ 2004-06-23  9:14       ` Karl Chen
  2004-06-23  9:59         ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Karl Chen @ 2004-06-23  9:14 UTC (permalink / raw)


>>>>> "Katsumi" == Katsumi Yamaoka <yamaoka@jpl.org> writes:
    Katsumi> I probably saw what should be improved.  How about
    Katsumi> the following patch?

Yes, works great!  Thanks.  Karl


-- 
Karl 2004-06-23 02:13




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

* Re: suggestion: don't treat ">From " as quote
  2004-06-23  9:14       ` Karl Chen
@ 2004-06-23  9:59         ` Katsumi Yamaoka
  2004-06-23 14:08           ` Reiner Steib
  0 siblings, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2004-06-23  9:59 UTC (permalink / raw)


>>>>> In <quack.20040623T0214.j5acyuprfm@hkn.eecs.berkeley.edu>
>>>>>	Karl Chen <quarl@nospam.quarl.org> wrote:

>     Katsumi> I probably saw what should be improved.  How about
>     Katsumi> the following patch?

> Yes, works great!  Thanks.  Karl

I've installed another version in the Gnus CVS.  Thank you.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

* Re: suggestion: don't treat ">From " as quote
  2004-06-23  9:59         ` Katsumi Yamaoka
@ 2004-06-23 14:08           ` Reiner Steib
  2004-06-23 14:23             ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Reiner Steib @ 2004-06-23 14:08 UTC (permalink / raw)


On Wed, Jun 23 2004, Katsumi Yamaoka wrote:

> I've installed another version in the Gnus CVS.  Thank you.

@@ -739,6 +746,10 @@
       ;; Ignore very long prefixes.
       (when (> end (+ begin gnus-cite-max-prefix))
 	(setq end (+ begin gnus-cite-max-prefix)))
+      ;; Ignore quoted envelope From_.
+      (when (and gnus-cite-ignore-quoted-from
+		 (looking-at ">from "))
+	(setq end (1+ begin)))
       (while (re-search-forward prefix-regexp (1- end) t)
 	;; Each prefix.
 	(setq end (match-end 0)

`M-x nitpicking-mode RET'...

Do MTAs also quote the lowercase "^from "?  Restricting it to
uppercase "F" may produce slightly less false matches.  Using (let
(case-fold-search) (looking-at ">From ")) or similar.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




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

* Re: suggestion: don't treat ">From " as quote
  2004-06-23 14:08           ` Reiner Steib
@ 2004-06-23 14:23             ` Katsumi Yamaoka
  0 siblings, 0 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2004-06-23 14:23 UTC (permalink / raw)


>>>>> In <v9zn6us6yf.fsf@marauder.physik.uni-ulm.de> 
>>>>>	Reiner Steib <4.uce.03.r.s@nurfuerspam.de> wrote:

> +      (when (and gnus-cite-ignore-quoted-from
> +		 (looking-at ">from "))

> `M-x nitpicking-mode RET'...

;)

> Do MTAs also quote the lowercase "^from "?  Restricting it to
> uppercase "F" may produce slightly less false matches.  Using (let
> (case-fold-search) (looking-at ">From ")) or similar.

Thanks!  That's a good idea.  Committed.
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



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

end of thread, other threads:[~2004-06-23 14:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-20 19:13 suggestion: don't treat ">From " as quote Karl Chen
2004-06-21 10:12 ` Katsumi Yamaoka
2004-06-22  8:23   ` Karl Chen
2004-06-22 11:31     ` Katsumi Yamaoka
2004-06-23  9:14       ` Karl Chen
2004-06-23  9:59         ` Katsumi Yamaoka
2004-06-23 14:08           ` Reiner Steib
2004-06-23 14:23             ` Katsumi Yamaoka

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