From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/62731 Path: news.gmane.org!not-for-mail From: Elias Oltmanns Newsgroups: gmane.emacs.gnus.general Subject: Re: Recovering newsgroup specific settings when editing drafts Date: Thu, 13 Apr 2006 14:44:28 +0200 Message-ID: <87fykhtzkj.fsf@denkblock.local> 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 1144932317 30476 80.91.229.2 (13 Apr 2006 12:45:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Apr 2006 12:45:17 +0000 (UTC) Original-X-From: ding-owner+m11258@lists.math.uh.edu Thu Apr 13 14:45:15 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 1FU1C9-0005CR-Ui for ding-account@gmane.org; Thu, 13 Apr 2006 14:45: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 1FU1C4-0008IG-00; Thu, 13 Apr 2006 07:45:04 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1FU1Bx-0008Ha-00 for ding@lists.math.uh.edu; Thu, 13 Apr 2006 07:44:57 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1FU1Bu-0001cy-Ix for ding@lists.math.uh.edu; Thu, 13 Apr 2006 07:44:57 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1FU1Bt-0001R2-00 for ; Thu, 13 Apr 2006 14:44:53 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FU1Bk-00058A-J7 for ding@gnus.org; Thu, 13 Apr 2006 14:44:44 +0200 Original-Received: from p50887ff0.dip.t-dialin.net ([80.136.127.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Apr 2006 14:44:44 +0200 Original-Received: from oltmanns by p50887ff0.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Apr 2006 14:44:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Lines: 64 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: p50887ff0.dip.t-dialin.net User-Agent: Gnus/5.110004 (No Gnus v0.4) Cancel-Lock: sha1:s0ffmeaO/c7q8LmjNQqYFYDEb+E= X-Spam-Score: -2.6 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:62731 Archived-At: Katsumi Yamaoka wrote: >>>>>> 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)))))) No. That doesn't work for me at all. I've just copied this very snippet and rubbed out all of my own adjustments to message-header-setup-hook. When I pressed F in order to respond to your message, the line reporting the value of X-Draft-From is inserted below the yanked in message of yours. Half way through I hit C-c C-d and quit gnus. After restarting gnus I pressed e on the draft response in the drafts buffer. This time the hook didn't output anything at all. Wondering about it and pressing C-c C-k straight away (answering no to the question whether to delete the backup file) made things even worse. Trying to leave the summary buffer produced a message saying something about changing to a deleted buffer but didn't return to the Group buffer. By the way, I'm using No Gnus and emacs devel (latest packages from debian sid). Regards, Elias