Re: Extracting Header and Content from an Article

Tim Landscheidt <[email protected]> Sun, 17 Nov 2024 14:29:58 +0000
Newsgroups gmane.emacs.gnus.general
Organization https://www.tim-landscheidt.de/
Message-ID <[email protected]>
"Husain Alshehhi" <[email protected]> wrote:

> When the point is in the summary page while viewing an
> article, or while a point is in an open article, I want to
> be able to (1) extract a header value which is not in the
> gnus-extra-headers, and (2) get some content from the
> article via regexp search (using capture groups). What are
> the right GNUS APIs to use for my use case?

I do not know if it is the right way, but I use patterns of
the type:

| (gnus-with-article-buffer
|   (gnus-fetch-original-field "User-Agent"))

Similarly, I use gnus-with-article-buffer and
save-mark-and-excursion to "enter" the article buffer, then
article-goto-body to go to the article body's top, and then
search-forward-regexp to capture text.

Tim