From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60064 Path: news.gmane.org!not-for-mail From: "Ted Zlatanov" Newsgroups: gmane.emacs.gnus.general Subject: Re: displaying initial words in a summary line (like gmail) Date: 28 Mar 2005 11:37:03 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <4nk6nrlob4.fsf@bwh.harvard.edu> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1112028508 15554 80.91.229.2 (28 Mar 2005 16:48:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Mar 2005 16:48:28 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+M8605@lists.math.uh.edu Mon Mar 28 18:48:23 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13] ident=mail) by ciao.gmane.org with esmtp (Exim 4.43) id 1DFxP7-0000od-B1 for ding-account@gmane.org; Mon, 28 Mar 2005 18:47:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1DFxEx-0006Uo-00; Mon, 28 Mar 2005 10:37:23 -0600 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1DFxEp-0006Ui-00 for ding@lists.math.uh.edu; Mon, 28 Mar 2005 10:37:15 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1DFxEk-0004bF-HV for ding@lists.math.uh.edu; Mon, 28 Mar 2005 10:37:10 -0600 Original-Received: from clifford.bwh.harvard.edu ([134.174.9.41] helo=mail.bwh.harvard.edu) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1DFxEj-0002p7-00 for ; Mon, 28 Mar 2005 18:37:09 +0200 Original-Received: (qmail 23313 invoked from network); 28 Mar 2005 16:34:40 -0000 Envelope-Sender: tzz@bwh.harvard.edu Envelope-Recipients: James.Leifer@inria.fr, ding@gnus.org, Original-Received: from asimov.bwh.harvard.edu (HELO asimov) (internal?.8?user:?tzz@[134.174.8.118]) (envelope-sender ) by mail.bwh.harvard.edu (qmail-ldap-1.03) with SMTP for ; 28 Mar 2005 16:34:39 -0000 Mail-Followup-To: "James Leifer" , ding@gnus.org Original-To: "James Leifer" X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" X-Hashcash: 1:20:050328:james.leifer@inria.fr::ZL0ga+9UuzYZN7zy:00000000000000000000000000000000000000003Nve X-Hashcash: 1:20:050328:ding@gnus.org::BV7IDecR2isj7DDl:00004U9n X-Hashcash: 1:20:050328:james.leifer@inria.fr::pqS6D55tzeEgzCho:00000000000000000000000000000000000000003AZ8 User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux) X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 3.0.1 (2004-10-22) on sysblade0.bwh.harvard.edu X-Spam-Status: No, score=-1.6 required=5.8 tests=AWL,BAYES_00 autolearn=ham version=3.0.1 X-Spam-Score: -4.9 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60064 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:60064 On Fri, 25 Mar 2005, James.Leifer@inria.fr wrote: > When visually scanning the summary buffer I would find it useful to > see the first couple of words of each message. Those who use Google > gmail might have noticed that this makes it far faster to identify to > the missed spams in the inbox and the missed hams in the spambox. > > Any ideas? Here's something that may work. The main problem is that it takes time to read the entire message, since Gnus doesn't do partial retrievals, so for large messages it's slow. This is especially bad with nnimap, because you have to use a network connection to retrieve the message. This function grabs the first 10 characters in the article body. You may want to extract words in some other way, it's up to you. Also if there aren't 10 characters available you may get an error - a regular expression is probably the best way to work this. (defun gnus-user-format-function-B (headers) (if (and headers gnus-newsgroup-name) (let* ((article (spam-fetch-field-fast -4332 'number headers))) ; -4332 is a fake article number (with-temp-buffer (gnus-request-article-this-buffer article gnus-newsgroup-name) (article-goto-body) (buffer-substring-no-properties (point) (+ (point) 10)))) "--invalid headers or group name--")) If you use this function or something like it, just put %uB in your summary format string. Ted