Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Jesper Harder <harder@myrealbox.com>
Subject: Re: gnus-user-format-function extract from body
Date: Fri, 12 Sep 2003 04:40:50 +0200	[thread overview]
Message-ID: <m3brtqd8zx.fsf@defun.localdomain> (raw)
In-Reply-To: <7er82ou5hf.fsf@rembrandt.fdm.uni-freiburg.de>

Thomas Gerds <gerds@fdm.uni-freiburg.de> writes:

> i am reading a mailing list where the 'From' header always refers to the
> person who rules the list. the informative 'From' is always the second
> line of the body. can anyone give me an example of an 
> gnus-user-format-function that extracts strings from the body?

Something like this:

(defun gnus-user-format-function-y (ignore)
  (if gnus-newsgroup-name
      (with-temp-buffer
	(gnus-request-article-this-buffer number gnus-newsgroup-name)
	(gnus-narrow-to-body)
	(if (re-search-forward "From \\(.*\\)$" nil t)
	    (match-string 1)
	  ""))
    ""))

It'll slow down summary buffer generation a lot, of course.


       reply	other threads:[~2003-09-12  2:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7er82ou5hf.fsf@rembrandt.fdm.uni-freiburg.de>
2003-09-12  2:40 ` Jesper Harder [this message]
     [not found]   ` <7epti64gvd.fsf@rembrandt.fdm.uni-freiburg.de>
2003-09-12 14:44     ` Jesper Harder

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=m3brtqd8zx.fsf@defun.localdomain \
    --to=harder@myrealbox.com \
    /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).