From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12522 Path: main.gmane.org!not-for-mail From: "St. Suika Roberts" Newsgroups: gmane.emacs.gnus.general Subject: Yet another washing function. Date: 04 Oct 1997 18:47:34 -0600 Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035152043 4204 80.91.224.250 (20 Oct 2002 22:14:03 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:14:03 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.7/8.8.7) with ESMTP id UAA16623 for ; Sat, 4 Oct 1997 20:16:25 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id WAA01813 for ; Sat, 4 Oct 1997 22:09:23 -0500 (CDT) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Sun, 5 Oct 1997 04:21:45 +0200 Original-Received: (qmail 2500 invoked by uid 504); 5 Oct 1997 02:21:38 -0000 Original-Received: (qmail 2497 invoked from network); 5 Oct 1997 02:21:37 -0000 Original-Received: from ppp-108.unm.edu (HELO misa.unm.edu) (kitty@129.24.14.108) by claymore.vcinet.com with SMTP; 5 Oct 1997 02:21:36 -0000 Original-Received: (from kitty@localhost) by misa.unm.edu (8.8.0/8.8.0) id VAA12817; Sat, 4 Oct 1997 21:27:03 -0500 Original-To: ding@gnus.org X-Mailer: Quassia Gnus v0.10/Emacs 20.0 Original-Lines: 35 Original-Xref: misa.genom.com queue:2 Xref: main.gmane.org gmane.emacs.gnus.general:12522 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:12522 I started working on this one back in May, but I only got it to where I like it today ^^;; It fixes M$Word style `smart quotes' back to normal ascii ones. ------------------------------ cut here ------------------------------ (defun gnus-article-fix-m$word () "Fix M$Word smartquotes in an article." (interactive) (save-excursion (with-current-buffer gnus-article-buffer (let ((buffer-read-only nil)) (goto-char (point-min)) (while (search-forward "\221" nil t) (replace-match "`" t t)) (goto-char (point-min)) (while (search-forward "\222" nil t) (replace-match "'" t t)) (goto-char (point-min)) (while (search-forward "\223" nil t) (replace-match "\"" t t)) (goto-char (point-min)) (while (search-forward "\224" nil t) (replace-match "\"" t t)))))) ------------------------------ cut here ------------------------------ I was thinking `W W m' might be a good binding for it. Thanks, Suika (yes, this makes four passes through the buffer. If elisp has a way to do this in one pass I'd be interested in learning about it) -- wroberts@tvi.cc.nm.us "Amazing what caffeine and no sense of self-preservation can do..." lists From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12539 Path: main.gmane.org!not-for-mail From: Kim-Minh Kaplan Newsgroups: gmane.emacs.gnus.general Subject: Re: Yet another washing function. Date: 05 Oct 1997 13:27:44 +0200 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: text/plain; charset=US-ASCII X-Trace: main.gmane.org 1035152058 4322 80.91.224.250 (20 Oct 2002 22:14:18 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:14:18 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.7/8.8.7) with ESMTP id NAA16304 for ; Mon, 6 Oct 1997 13:11:41 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id PAA21195 for ; Mon, 6 Oct 1997 15:04:28 -0500 (CDT) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Mon, 6 Oct 1997 21:01:41 +0200 Original-Received: (qmail 9430 invoked by uid 504); 6 Oct 1997 19:01:39 -0000 Original-Received: (qmail 9427 invoked from network); 6 Oct 1997 19:01:35 -0000 Original-Received: from lombric.s-ip.eunet.fr (root@193.107.197.179) by claymore.vcinet.com with SMTP; 6 Oct 1997 19:01:27 -0000 Original-Received: (from kaplan@localhost) by lombric.s-ip.eunet.fr (8.8.5/8.8.5) id NAA02077; Sun, 5 Oct 1997 13:27:45 +0200 Original-To: ding@gnus.org X-Face: C!5Mk_!qB]35}VpD|H>GN/@fk%~7:*/x8&~\]|r|)/zV?rJ){uX4Nh`a$L/z__Kx4Gt!mDU 3kZlj)F2]Ds$?l';SO9]v^|[i2nY`pZ+mu+HT%5ITkuP#e]@8F4@Hc.=]oN1+d\M@Rl>-$C?h$yntf -JVx)3L2}VzG.!bQEy]~I_3fup`HtZ^t/Iz.|Vh$~o`^g\ In-Reply-To: "St. Suika Roberts"'s message of "04 Oct 1997 18:47:34 -0600" Original-Lines: 13 X-Mailer: Quassia Gnus v0.12/XEmacs 19.15 Xref: main.gmane.org gmane.emacs.gnus.general:12539 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:12539 >>>>> On October 4, 1997, St Suika Roberts said: Suika> If elisp has a way to do this in one pass I'd be interested in Suika> learning about it The function `skip-chars-forward' and `following-char' could do it. You could also do it by tweaking the display table of the article buffer. It would probably be more efficient, but it will be more difficult to remove the special display properties for normal articles. Kim-Minh. From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12529 Path: main.gmane.org!not-for-mail From: Greg Stark Newsgroups: gmane.emacs.gnus.general Subject: Re: Yet another washing function. Date: 05 Oct 1997 20:57:31 -0400 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035152048 4236 80.91.224.250 (20 Oct 2002 22:14:08 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:14:08 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.7/8.8.7) with ESMTP id TAA07550 for ; Sun, 5 Oct 1997 19:52:39 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id VAA02503 for ; Sun, 5 Oct 1997 21:45:19 -0500 (CDT) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Mon, 6 Oct 1997 02:57:44 +0200 Original-Received: (qmail 5865 invoked by uid 504); 6 Oct 1997 00:57:43 -0000 Original-Received: (qmail 5862 invoked from network); 6 Oct 1997 00:57:41 -0000 Original-Received: from portF43.Generation.NET (brnstnd@kramden.acf.nyu.edu@205.205.119.23) by claymore.vcinet.com with SMTP; 6 Oct 1997 00:57:41 -0000 Original-Received: by portF43.Generation.NET id m0xI1UK-000AzUC (Debian Smail-3.2 1996-Jul-4 #2); Sun, 5 Oct 1997 20:57:32 -0400 (EDT) Original-To: ding@gnus.org In-Reply-To: Stainless Steel Rat's message of "05 Oct 1997 10:23:48 -0400" Original-Lines: 33 X-Mailer: Gnus v5.4.64/Emacs 19.34 Xref: main.gmane.org gmane.emacs.gnus.general:12529 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:12529 Please try to avoid generating garbage whenever possible, the regular expression functions generate a lot of wasted memory and the loops in elisp are very inefficient compared to using primitives that do loops in C. Also, replace-match probably moves the gap to that point which means you're doing the equivalent of memoving the entire article a small bit at a time. I've noticed that article washing is a noticeable delay. It might be worth looking through the existing washing functions for code that generates excess garbage, do loops in elisp that can be done in C with primitives, or move the gap unecessarily. Here's an implementation that does none of these: (subst-char-in-region (point-min) (point-max) ?\221 ?`) (subst-char-in-region (point-min) (point-max) ?\222 ?') (subst-char-in-region (point-min) (point-max) ?\223 ?\") (subst-char-in-region (point-min) (point-max) ?\224 ?\") An even better alternative might be to use translate-region but it's a bit awkward and likely to cause problems with XEmacs 20 and Emacs 20 where characters and integers are distinct. It may not actually be faster than a few loops through the text, though i'm not sure if the break-even point would be more or less than four. (let ((x (make-string 225 ?x)) (i -1)) (while (< (incf i) (length x)) (aset x i i)) (aset x ?\221 ?`) (aset x ?\222 ?') (aset x ?\223 ?\") (aset x ?\224 ?\") x (translate-region (point-min) (point-max) x)) From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12541 Path: main.gmane.org!not-for-mail From: wmperry@aventail.com (William M. Perry) Newsgroups: gmane.emacs.gnus.general Subject: Re: Yet another washing function. Date: 06 Oct 1997 12:57:45 -0700 Message-ID: <86g1qed5qe.fsf@kramer.in.aventail.com> References: Reply-To: wmperry@aventail.com NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035152059 4331 80.91.224.250 (20 Oct 2002 22:14:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:14:19 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.7/8.8.7) with ESMTP id OAA17116 for ; Mon, 6 Oct 1997 14:17:37 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id QAA21444 for ; Mon, 6 Oct 1997 16:10:26 -0500 (CDT) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Mon, 6 Oct 1997 22:00:46 +0200 Original-Received: (qmail 9661 invoked by uid 504); 6 Oct 1997 20:00:44 -0000 Original-Received: (qmail 9658 invoked from network); 6 Oct 1997 20:00:44 -0000 Original-Received: from newman.aventail.com (root@199.238.236.1) by claymore.vcinet.com with SMTP; 6 Oct 1997 20:00:42 -0000 Original-Received: from kramer.in.aventail.com (wmperry@kramer.in.aventail.com [192.168.1.12]) by newman.aventail.com (8.8.5/8.8.5) with ESMTP id NAA28499; Mon, 6 Oct 1997 13:00:41 -0700 (PDT) Original-Received: (from wmperry@localhost) by kramer.in.aventail.com (8.8.5/8.8.5) id MAA26745; Mon, 6 Oct 1997 12:57:45 -0700 Original-To: "St. Suika Roberts" Errors-to: wmperry@aventail.com X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7 writes: > I started working on this one back in May, but I only got it to where > I like it today ^^;; > > It fixes M$Word style `smart quotes' back to normal ascii ones. > ------------------------------ cut here ------------------------------ > (defun gnus-article-fix-m$word () > "Fix M$Word smartquotes in an article." > (interactive) > (save-excursion > (with-current-buffer gnus-article-buffer > (let ((buffer-read-only nil)) > (goto-char (point-min)) > (while (search-forward "\221" nil t) > (replace-match "`" t t)) > (goto-char (point-min)) > (while (search-forward "\222" nil t) > (replace-match "'" t t)) > (goto-char (point-min)) > (while (search-forward "\223" nil t) > (replace-match "\"" t t)) > (goto-char (point-min)) > (while (search-forward "\224" nil t) > (replace-match "\"" t t)))))) I would use subst-char-in-region: (defun gnus-article-fix-quotes () (interactive) (with-current-buffer gnus-article-buffer (let ((buffer-read-only nil) (inhibit-read-only t)) (subst-char-in-region (point-min) (point-max) ?\221 ?`) (subst-char-in-region (point-min) (point-max) ?\222 ?') (subst-char-in-region (point-min) (point-max) ?\223 ?\") (subst-char-in-region (point-min) (point-max) ?\224 ?\")))) -Bill P. From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12547 Path: main.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.gnus.general Subject: Re: Yet another washing function. Date: 07 Oct 1997 10:06:14 -0400 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035152064 4361 80.91.224.250 (20 Oct 2002 22:14:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:14:24 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.7/8.8.7) with ESMTP id JAA26471 for ; Tue, 7 Oct 1997 09:00:02 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id KAA23197 for ; Tue, 7 Oct 1997 10:52:44 -0500 (CDT) Original-Received: from peoria.mt.cs.cmu.edu (PEORIA.MT.CS.CMU.EDU [128.2.110.42]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Tue, 7 Oct 1997 16:06:17 +0200 Original-Received: by peoria.mt.cs.cmu.edu (AIX 4.1/UCB 5.64/4.03) id AA06550; Tue, 7 Oct 1997 10:06:15 -0400 Original-To: ding@ifi.uio.no In-Reply-To: "St. Suika Roberts"'s message of "04 Oct 1997 18:47:34 -0600" Original-Lines: 53 X-Mailer: Gnus v5.4.59/Emacs 19.34 Xref: main.gmane.org gmane.emacs.gnus.general:12547 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:12547 "St. Suika Roberts" writes: > I started working on this one back in May, but I only got it to where > I like it today ^^;; > > It fixes M$Word style `smart quotes' back to normal ascii ones. > ------------------------------ cut here ------------------------------ > (defun gnus-article-fix-m$word () > "Fix M$Word smartquotes in an article." > (interactive) > (save-excursion > (with-current-buffer gnus-article-buffer > (let ((buffer-read-only nil)) > (goto-char (point-min)) > (while (search-forward "\221" nil t) > (replace-match "`" t t)) > (goto-char (point-min)) > (while (search-forward "\222" nil t) > (replace-match "'" t t)) > (goto-char (point-min)) > (while (search-forward "\223" nil t) > (replace-match "\"" t t)) > (goto-char (point-min)) > (while (search-forward "\224" nil t) > (replace-match "\"" t t)))))) > ------------------------------ cut here ------------------------------ > > I was thinking `W W m' might be a good binding for it. Hmm... I do something similar in mine: (defun md5i-special-display-table () (let ((bdt (make-display-table))) (aset bdt 13 []) ;Zap ^Ms (aset bdt 25 []) ;Zap ^Ys (aset bdt 133 [?. ?. ?.]) ;\205 = ... (aset bdt 145 [?`]) ;\221 = ` (aset bdt 146 [?']) ;\222 = ' (aset bdt 147 [?\"]) ;\223 = " (aset bdt 148 [?\"]) ;\224 = " (aset bdt 149 [?*]) ;\225 = * (aset bdt 150 [?- ?-]) ;\226 = -- (aset bdt 151 [?- ?- ?-]) ;\227 = --- (aset bdt 153 [?( ?T ?m ?)]) ;\231 = (Tm) (setq buffer-display-table bdt))) I then placed this in the gnus-article-display-hook. (The list is not complete, however, as I have added the entries as I have come across them.) -- Michael Duggan (md5i@cs.cmu.edu) From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12554 Path: main.gmane.org!not-for-mail From: Lars Balker Rasmussen Newsgroups: gmane.emacs.gnus.general Subject: Re: Yet another washing function. Date: 08 Oct 1997 18:23:29 +0200 Message-ID: <0fen5w8br2.fsf@heimdal.mjolner.dk> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035152070 4406 80.91.224.250 (20 Oct 2002 22:14:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:14:30 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.7/8.8.7) with ESMTP id KAA17434 for ; Wed, 8 Oct 1997 10:50:14 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id MAA01174 for ; Wed, 8 Oct 1997 12:42:52 -0500 (CDT) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Wed, 8 Oct 1997 18:23:40 +0200 Original-Received: (qmail 18278 invoked by uid 504); 8 Oct 1997 16:23:32 -0000 Original-Received: (qmail 18275 invoked from network); 8 Oct 1997 16:23:32 -0000 Original-Received: from heimdal.mjolner.dk (130.225.8.65) by claymore.vcinet.com with SMTP; 8 Oct 1997 16:23:31 -0000 Original-Received: (from lbr@localhost) by heimdal.mjolner.dk (8.7.6/8.7.3) id SAA03969; Wed, 8 Oct 1997 18:23:29 +0200 (MET DST) Original-To: ding@gnus.org In-Reply-To: Greg Stark's message of "05 Oct 1997 20:57:31 -0400" Original-Lines: 25 X-Mailer: Gnus v5.5/Emacs 20.2 Xref: main.gmane.org gmane.emacs.gnus.general:12554 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:12554 Greg Stark writes: > I've noticed that article washing is a noticeable delay. Quite! If I try to view a LARGE article which I know what's in, I might as well press C-g after a couple of seconds to avoid waiting for ages. The article appears pretty much like I'd expect if I'd waited the entire time, but I haven't looked into it further. That's annoying... Relevant hooks (that I know of): gnus-article-display-hook's value is (gnus-article-highlight gnus-article-hide-pgp gnus-article-hide-headers-if-wanted gnus-article-hide-boring-headers gnus-article-treat-overstrike gnus-article-maybe-highlight) gnus-article-prepare-hook's value is (gnus-article-de-quoted-unreadable) > (subst-char-in-region (point-min) (point-max) ?\221 ?`) > (subst-char-in-region (point-min) (point-max) ?\222 ?') > (subst-char-in-region (point-min) (point-max) ?\223 ?\") > (subst-char-in-region (point-min) (point-max) ?\224 ?\") Might as well have NOUNDO set to t, right? -- Lars Balker Rasmussen, Software Engineer, Mjolner Informatics ApS lbr@mjolner.dk From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12574 Path: main.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Yet another washing function. Date: 12 Oct 1997 16:53:00 +0200 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035152086 4499 80.91.224.250 (20 Oct 2002 22:14:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:14:46 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.7/8.8.7) with ESMTP id JAA20705 for ; Sun, 12 Oct 1997 09:00:49 -0700 Original-Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with SMTP id KAA15171 for ; Sun, 12 Oct 1997 10:52:54 -0500 (CDT) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Sun, 12 Oct 1997 17:13:27 +0200 Original-Received: (qmail 1549 invoked by uid 504); 12 Oct 1997 15:13:26 -0000 Original-Received: (qmail 1546 invoked from network); 12 Oct 1997 15:13:26 -0000 Original-Received: from ifi.uio.no (0@129.240.64.2) by claymore.vcinet.com with SMTP; 12 Oct 1997 15:13:26 -0000 Original-Received: from proletcult.slip.ifi.uio.no (larsi@xyplex20.uio.no [129.240.154.40]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Sun, 12 Oct 1997 17:13:24 +0200 Original-Received: (from larsi@localhost) by proletcult.slip.ifi.uio.no (8.8.2/8.8.2) id RAA18376; Sun, 12 Oct 1997 17:14:35 +0200 Mail-Copies-To: never Original-To: ding@gnus.org In-Reply-To: "St. Suika Roberts"'s message of "04 Oct 1997 18:47:34 -0600" X-Mailer: Quassia Gnus v0.13/Emacs 19.34 X-Face: &w!^oO~dS|}-P0~ge{$c!h\ writes: > I started working on this one back in May, but I only got it to where > I like it today ^^;; I've added two functions; `article-translate-characters' that does what you'd think; and `gnus-article-treat-dumbquotes' that uses this function to do its work. Perhaps the command could take a symbolic prefix to do other types of translations? Anyone have good "tr" commands that they find useful? -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12819 Path: main.gmane.org!not-for-mail From: Lars Balker Rasmussen Newsgroups: gmane.emacs.gnus.general Subject: Re: Yet another washing function. Date: 13 Nov 1997 19:06:45 +0100 Message-ID: <0fg1p0is7e.fsf@heimdal.mjolner.dk> References: <0fen5w8br2.fsf@heimdal.mjolner.dk> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035152290 5858 80.91.224.250 (20 Oct 2002 22:18:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:18:10 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.8/8.8.8) with ESMTP id MAA21986 for ; Thu, 13 Nov 1997 12:01:42 -0800 Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with ESMTP id NAA10145 for ; Thu, 13 Nov 1997 13:41:21 -0600 (CST) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no (8.8.7/8.8.7/ifi0.2) with SMTP id TAA12255 for ; Thu, 13 Nov 1997 19:06:52 +0100 (MET) Original-Received: (qmail 13810 invoked by uid 504); 13 Nov 1997 18:06:51 -0000 Original-Received: (qmail 13807 invoked from network); 13 Nov 1997 18:06:50 -0000 Original-Received: from heimdal.mjolner.dk (130.225.8.65) by claymore.vcinet.com with SMTP; 13 Nov 1997 18:06:50 -0000 Original-Received: (from lbr@localhost) by heimdal.mjolner.dk (8.7.6/8.7.3) id TAA27359; Thu, 13 Nov 1997 19:06:45 +0100 (MET) Original-To: ding@gnus.org Original-Lines: 59 X-Mailer: Gnus v5.5/Emacs 20.2 Xref: main.gmane.org gmane.emacs.gnus.general:12819 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:12819 I wrote on October 8 1997: > Greg Stark writes: >> I've noticed that article washing is a noticeable delay. > > Quite! If I try to view a LARGE article which I know what's in, I might > as well press C-g after a couple of seconds to avoid waiting for ages. > The article appears pretty much like I'd expect if I'd waited the entire > time, but I haven't looked into it further. That's annoying... After receiving a few 30000-lines mail these last couple of days I broke down and investigated a bit more. The HUGE time-wasters are perhaps unsurprisingly the highlight functions in gnus-article-display-hook. By applying the following nasty hack to 5.4.67's gnus-art.el I'm a much happier man. Is it possible to clean up the highlight functions[1] to make them more efficient, or could my hack be cleaned up[2] and used? Whatever, 30000-line mails now pops up in an Article buffer the instant I want them, not after I've pressed C-g... Cheers, Lars ---------------------------------------------------------------------- --- gnus-art.el.orig Sat Sep 13 15:43:22 1997 +++ gnus-art.el Thu Nov 13 18:53:55 1997 @@ -1901,6 +1901,14 @@ (forward-line line) (point))))) +(defun gnus-run-article-display-hook () + (if (and (gnus-fetch-field "Lines") + (> (string-to-number (gnus-fetch-field "Lines")) 1000)) + (loop for hook in gnus-article-display-hook do + (if (not (string-match "highlight" (symbol-name hook))) + (funcall hook))) + (run-hooks 'gnus-article-display-hook))) + (defun gnus-article-prepare (article &optional all-headers header) "Prepare ARTICLE in article mode buffer. ARTICLE should either be an article number or a Message-ID. @@ -2010,7 +2018,7 @@ (funcall gnus-show-mime-method) (funcall gnus-decode-encoded-word-method))) ;; Perform the article display hooks. - (run-hooks 'gnus-article-display-hook)) + (gnus-run-article-display-hook)) ;; Do page break. (goto-char (point-min)) (setq gnus-page-broken ---------------------------------------------------------------------- [1] I noticed that I have both gnus-article-highlight and gnus-article-maybe-highlight in my gnus-article-display-hook. I suppose I have a reason for that. [2] I suppose a variable instead of my hardcoded 1000 would be nice :-) -- Lars Balker Rasmussen, Software Engineer, Mjolner Informatics ApS lbr@mjolner.dk From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12822 Path: main.gmane.org!not-for-mail From: Lars Magne Ingebrigtsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Yet another washing function. Date: 13 Nov 1997 22:37:56 +0100 Message-ID: References: <0fen5w8br2.fsf@heimdal.mjolner.dk> <0fg1p0is7e.fsf@heimdal.mjolner.dk> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1035152292 5879 80.91.224.250 (20 Oct 2002 22:18:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:18:12 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.8/8.8.8) with ESMTP id PAA26589 for ; Thu, 13 Nov 1997 15:51:19 -0800 Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with ESMTP id RAA11520 for ; Thu, 13 Nov 1997 17:51:47 -0600 (CST) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no (8.8.7/8.8.7/ifi0.2) with SMTP id XAA06556 for ; Thu, 13 Nov 1997 23:33:10 +0100 (MET) Original-Received: (qmail 480 invoked by uid 504); 13 Nov 1997 22:33:09 -0000 Original-Received: (qmail 467 invoked from network); 13 Nov 1997 22:33:07 -0000 Original-Received: from xyplex17.uio.no (HELO sparky.gnus.org) (129.240.154.37) by claymore.vcinet.com with SMTP; 13 Nov 1997 22:33:06 -0000 Original-Received: (from larsi@localhost) by sparky.gnus.org (8.8.5/8.8.5) id XAA09122; Thu, 13 Nov 1997 23:33:02 +0100 Mail-Copies-To: never Original-To: ding@gnus.org In-Reply-To: Lars Balker Rasmussen's message of "13 Nov 1997 19:06:45 +0100" X-Mailer: Quassia Gnus v0.14/XEmacs 19.15 X-Face: &w!^oO~dS|}-P0~ge{$c!h\ writes: > By applying the following nasty hack to 5.4.67's gnus-art.el I'm a much > happier man. Is it possible to clean up the highlight functions[1] to > make them more efficient, or could my hack be cleaned up[2] and used? I've now added this to the todo list. -- (domestic pets only, the antidote for overdose, milk.) larsi@gnus.org * Lars Magne Ingebrigtsen