From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60333 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: equivalent of (vm-subject-of msg) etc Date: Wed, 18 May 2005 19:01:10 +0900 Organization: Emacsen advocacy group Message-ID: References: <871x86ryl8.fsf@mat.ucm.es> <87psvpg9se.fsf@mat.ucm.es> <87hdh06fzr.fsf@mat.ucm.es> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1116410609 412 80.91.229.2 (18 May 2005 10:03:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 May 2005 10:03:29 +0000 (UTC) Original-X-From: ding-owner+M8860@lists.math.uh.edu Wed May 18 12:03:26 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DYLNQ-000399-Uo for ding-account@gmane.org; Wed, 18 May 2005 12:02:09 +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 1DYLMk-0003wW-00; Wed, 18 May 2005 05:01:26 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1DYLMf-0003wR-00 for ding@lists.math.uh.edu; Wed, 18 May 2005 05:01:21 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1DYLMe-0006GJ-5O for ding@lists.math.uh.edu; Wed, 18 May 2005 05:01:20 -0500 Original-Received: from washington.hostforweb.net ([66.225.201.13]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1DYLMd-0003So-00 for ; Wed, 18 May 2005 12:01:19 +0200 Original-Received: from localhost ([127.0.0.1]) by washington.hostforweb.net with esmtpa (Exim 4.50) id 1DYLMc-0007fZ-O8 for ding@gnus.org; Wed, 18 May 2005 05:01:19 -0500 Original-To: ding@gnus.org X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:poq87ok6Pat5C3McFC3jOSpM5sM= X-Hashcash: 1:20:050518:ding@gnus.org::O5k3X0mmpuc2wSvt:0000DC62 X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - washington.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -4.8 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:60333 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:60333 --=-=-= >>>>> In <87hdh06fzr.fsf@mat.ucm.es> Uwe Brauer wrote: > I tried > (add-hook 'gnus-article-mode-hook 'my-set-gnus-time) > (defun my-set-gnus-time () > (interactive) > (format-time-string > "%b %d, %Y %T" > (apply 'encode-time > (parse-time-string > (mail-header-date gnus-current-headers))))) > But that did not work out, what is my mistake? The function only returns a string but it is never inserted or displayed anywhere. Furthermore, gnus-article-mode-hook is evaluated only when the article buffer is created (Gnus keeps using it for all articles as long as it is not deleted). Well, while I don't know what you'd like to do, how about the following? --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (add-hook 'gnus-article-prepare-hook 'my-set-gnus-time) (defun my-set-gnus-time () (article-goto-body) (let ((inhibit-read-only t)) (insert (format-time-string "** This article was sent at: %b %d, %Y %T **\n\n" (apply 'encode-time (parse-time-string (mail-header-date gnus-current-headers))))))) --=-=-=--