From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/58785 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:10:20 +0200 Organization: Probably a good idea Sender: ding-owner@lists.math.uh.edu Message-ID: <87k6tzswib.fsf@dod.no> References: <87oejbsyaq.fsf@dod.no> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1097338282 6809 80.91.229.6 (9 Oct 2004 16:11:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Oct 2004 16:11:22 +0000 (UTC) Original-X-From: ding-owner+M7324@lists.math.uh.edu Sat Oct 09 18:11:10 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 1CGJoM-0003o3-00 for ; Sat, 09 Oct 2004 18:11:10 +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 1CGJno-0001FT-00; Sat, 09 Oct 2004 11:10:37 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1CGJnk-0001FO-00 for ding@lists.math.uh.edu; Sat, 09 Oct 2004 11:10:32 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1CGJni-0001Xe-Ar for ding@lists.math.uh.edu; Sat, 09 Oct 2004 11:10:30 -0500 Original-Received: from main.gmane.org (main.gmane.org [80.91.229.2]) by justine.libertine.org (Postfix) with ESMTP id 418BB3A0042 for ; Sat, 9 Oct 2004 11:10:28 -0500 (CDT) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CGJng-000594-00 for ; Sat, 09 Oct 2004 18:10:28 +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:10:28 +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:10:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 30 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:oymgEtTU04HcTIOV0XqS+W1HFDQ= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:58785 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:58785 >>>>> 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, since this hook is called from the summary buffer, in what seems to be the appropriate moment. But with the code below, I am asked if I wish to save the diary entry on an unread article. But the article is never marked read. Looks like my-gnus-check-outlook interfers with gnus-summary-mark-read-and-unread-as-read, which is the other member of gnus-mark-article-hook. Hm... (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 (let ((mark (gnus-summary-article-mark))) (when (gnus-unread-mark-p mark) (set-buffer gnus-article-buffer) (u-appt-check-outlook))))) (add-hook 'gnus-mark-article-hook 'my-gnus-check-outlook)