From: Steinar Bang <sb@dod.no>
Subject: Re: Find tick state from gnus-article-prepare-hook?
Date: Sat, 09 Oct 2004 18:42:00 +0200 [thread overview]
Message-ID: <87ekk7sv1j.fsf@dod.no> (raw)
In-Reply-To: <87k6tzswib.fsf@dod.no>
>>>>> Steinar Bang <sb@dod.no>:
>>>>> Steinar Bang <sb@dod.no>:
>> Is it possible to find the tick state of the current article, from a
>> function called from gnus-article-prepare-hook?
>> I need to check whether the article is unread, or not. I wish to
>> use u-appt.el to parse messages for Outlook appointment invitations,
>> and I only want to be prompted for if I wish to save the appointment
>> in the diary, the first time I read the message.
> I tried using gnus-mark-article-hook instead,
[snip! Masked setting of mark]
Back to gnus-article-prepare-hook.
I tried skipping back to the summary buffer for a peek, in the hope
that the cursor would be positioned at the correct spot. But that
doesn't work. because gnus-summary-article-mark returns `?R' at this
point. Ie. something that will make gnus-unread-mark-p return nil.
(defun my-gnus-check-outlook ()
"Run from a hook to check new messages in Gnus for Outlook appointment
invitations, and offer to save them in the diary."
(save-excursion
(set-buffer gnus-summary-buffer)
(let ((mark (gnus-summary-article-mark)))
(when (gnus-unread-mark-p mark)
(set-buffer gnus-article-buffer)
(u-appt-check-outlook)))))
(add-hook 'gnus-article-prepare-hook 'my-gnus-check-outlook)
next prev parent reply other threads:[~2004-10-09 16:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-09 15:31 Steinar Bang
2004-10-09 16:10 ` Steinar Bang
2004-10-09 16:42 ` Steinar Bang [this message]
2004-10-10 21:13 ` Steinar Bang
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=87ekk7sv1j.fsf@dod.no \
--to=sb@dod.no \
/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).