From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62696 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: Recovering newsgroup specific settings when editing drafts Date: Thu, 13 Apr 2006 10:18:33 +0900 Organization: Emacsen advocacy group Message-ID: References: <878xqbawko.fsf@denkblock.local> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1144891205 9743 80.91.229.2 (13 Apr 2006 01:20:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Apr 2006 01:20:05 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+m11223@lists.math.uh.edu Thu Apr 13 03:20:03 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FTqV5-0005aH-D3 for ding-account@gmane.org; Thu, 13 Apr 2006 03:19:59 +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 1FTqUz-00055U-00; Wed, 12 Apr 2006 20:19:53 -0500 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FTqTp-00055M-00 for ding@lists.math.uh.edu; Wed, 12 Apr 2006 20:18:41 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1FTqTn-0006Xf-6P for ding@lists.math.uh.edu; Wed, 12 Apr 2006 20:18:41 -0500 Original-Received: from washington.hostforweb.net ([66.225.201.13]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FTqTm-0000uQ-00 for ; Thu, 13 Apr 2006 03:18:38 +0200 Original-Received: from [205.234.185.198] (port=53034 helo=mail.jpl.org) by washington.hostforweb.net with esmtpa (Exim 4.52) id 1FTqW2-0000KS-6v; Wed, 12 Apr 2006 20:20:58 -0500 Original-To: Elias Oltmanns 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.110005 (No Gnus v0.5) Emacs/22.0.50 (usg-unix-v) Cancel-Lock: sha1:9I/CF0qN6aCPxz5kzXSOvJ4bsh4= 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: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62696 Archived-At: >>>>> In <878xqbawko.fsf@denkblock.local> >>>>> Elias Oltmanns wrote: > here is a problem which I couldn't find a solution for. If you have > code hooked into message-setup-hook or message-header-setup-hook which > performs various actions depending on the current group, you would > often want to have this code referring to the original group of a > draft when pressing e in the drafts group. Good examples are changing > ispell-local-dictionary or pgg-default-user-id. Since X-Draft-From > holds the name of the group in which the message was originally > created, the obvious way is to make the code refer to this header. > However, message-fetch-field / message-field-value don't seem to have > access to this variable by the time message-(header-)setup-hook is > run. What would be the right way to accomplish my goal? At that time, the `message-required-headers' variable has the value of X-Draft-From header as: (X-Draft-From lambda nil (gnus-inews-make-draft-meta-information "GROUP_NAME" '(ARTICLES))) How about the following snippet? (with-temp-buffer (message-generate-headers message-required-headers) (message-fetch-field "X-Draft-From")) I used the following hook to verify that it works. (add-hook 'message-header-setup-hook (lambda nil (let ((x-draft-from (with-temp-buffer (message-generate-headers message-required-headers) (message-fetch-field "X-Draft-From")))) (save-restriction (widen) (message-goto-body) (insert (format "X-Draft-From's value is `%s'.\n" x-draft-from))))))