From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/58787 Path: main.gmane.org!not-for-mail From: Steinar Bang Newsgroups: gmane.emacs.gnus.general Subject: Re: Find tick state from gnus-article-prepare-hook? Date: Sat, 09 Oct 2004 18:42:00 +0200 Organization: Probably a good idea Sender: ding-owner@lists.math.uh.edu Message-ID: <87ekk7sv1j.fsf@dod.no> References: <87oejbsyaq.fsf@dod.no> <87k6tzswib.fsf@dod.no> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1097340184 11133 80.91.229.6 (9 Oct 2004 16:43:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Oct 2004 16:43:04 +0000 (UTC) Original-X-From: ding-owner+M7325@lists.math.uh.edu Sat Oct 09 18:42:52 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13] ident=mail) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CGKJ1-0005RY-00 for ; Sat, 09 Oct 2004 18:42:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1CGKIQ-0001Lh-00; Sat, 09 Oct 2004 11:42:14 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1CGKIJ-0001Lb-00 for ding@lists.math.uh.edu; Sat, 09 Oct 2004 11:42:07 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1CGKII-0001o9-8C for ding@lists.math.uh.edu; Sat, 09 Oct 2004 11:42:06 -0500 Original-Received: from main.gmane.org (main.gmane.org [80.91.229.2]) by justine.libertine.org (Postfix) with ESMTP id 07D393A0042 for ; Sat, 9 Oct 2004 11:42:04 -0500 (CDT) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CGKIF-0006aw-00 for ; Sat, 09 Oct 2004 18:42:03 +0200 Original-Received: from cm-80.111.90.110.chello.no ([80.111.90.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 09 Oct 2004 18:42:03 +0200 Original-Received: from sb by cm-80.111.90.110.chello.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 09 Oct 2004 18:42:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 32 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cm-80.111.90.110.chello.no Mail-Copies-To: never User-Agent: Gnus/5.110003 (No Gnus v0.3) XEmacs/21.4 (Security Through Obscurity, linux) Cancel-Lock: sha1:rf0McT6TX+Go093tviMuH0eFd/0= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:58787 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:58787 >>>>> Steinar Bang : >>>>> Steinar Bang : >> 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)