Gnus development mailing list
 help / color / mirror / Atom feed
From: "Ted Zlatanov" <tzz@lifelogs.com>
Cc: ding@gnus.org
Subject: Re: displaying initial words in a summary line (like gmail)
Date: 28 Mar 2005 11:37:03 -0500	[thread overview]
Message-ID: <4nk6nrlob4.fsf@bwh.harvard.edu> (raw)
In-Reply-To: <r77psxnhady.fsf@muscadet.inria.fr>

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



      parent reply	other threads:[~2005-03-28 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-25 18:02 James Leifer
2005-03-26  2:48 ` Miles Bader
2005-03-28 16:37 ` Ted Zlatanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4nk6nrlob4.fsf@bwh.harvard.edu \
    --to=tzz@lifelogs.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).