Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Damien Collard <damien.collard@distfp.net>
To: info-gnus-english@gnu.org
Subject: Treat article body iff header matches predicate?
Date: Wed, 20 Mar 2019 11:30:49 +0100	[thread overview]
Message-ID: <m28sx97s86.fsf@gandi.net> (raw)

Hello,

I receive posts from a Discourse forum as e-mails, but their quote
(citation) format has poor readability, so I have written a treatment
function that converts such quotes into the usual e-mail citation
format.

I added this function to `gnus-treatment-function-alist', it is applied
to all parts (associated treatment variable set to t) and it works fine.

Now, currently this treatment is performed regardless of the provenance
of an e-mail, while I'd like it to be performed /iff/ the e-mail is
actually from Discourse.

From "Customizing articles" in Gnus' manual, there is no way to set a
treatment variable so the treatment applies to /both/ header and body.

However, a treatment variable can also be set to a "list where the first
element is not a string", and in that case it is interpreted as a
predicate. I tried using the `from` predicate as available in
`nnmail-split-fancy`, but it isn't recognized.

Is there a way to access the headers from a treatment function?

--
Damien Collard


             reply	other threads:[~2019-03-20 10:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 10:30 Damien Collard [this message]
2019-03-20 11:31 ` Fraga, Eric
2019-03-20 12:25   ` Damien Collard
2019-03-20 14:04     ` Fraga, Eric
2019-03-22  7:49   ` Damien Collard
2019-03-22  8:15     ` Adam Sjøgren
2019-03-22  8:51       ` Damien Collard
2019-03-22 12:46       ` Damien Collard
2019-03-22 18:05         ` Adam Sjøgren

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=m28sx97s86.fsf@gandi.net \
    --to=damien.collard@distfp.net \
    --cc=info-gnus-english@gnu.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).