From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84809 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Hooks for moving an article and for setting it expirable Date: Sun, 24 Aug 2014 11:22:10 +0800 Message-ID: <87a96uy3kt.fsf@ericabrahamsen.net> References: <87silaykb6.fsf@aura.christopherculver.com> <87mwbflp13.fsf@ericabrahamsen.net> <87fvguzxke.fsf@aura.christopherculver.com> <87d2byoe97.fsf@ericabrahamsen.net> <87zjf1j4dt.fsf@aura.christopherculver.com> <87mwb1lvrz.fsf@ericabrahamsen.net> <87r40dhl7u.fsf@aura.christopherculver.com> <87iolphg68.fsf@aura.christopherculver.com> <8738ctl1n8.fsf@ericabrahamsen.net> <87r40bdo2e.fsf@aura.christopherculver.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1408850458 21792 80.91.229.3 (24 Aug 2014 03:20:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Aug 2014 03:20:58 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M33052@lists.math.uh.edu Sun Aug 24 05:20:51 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XLOMM-00067o-FC for ding-account@gmane.org; Sun, 24 Aug 2014 05:20:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1XLOLW-0003iI-VH; Sat, 23 Aug 2014 22:19:59 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1XLOLU-0003i4-3K for ding@lists.math.uh.edu; Sat, 23 Aug 2014 22:19:56 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1XLOLS-00049R-4W for ding@lists.math.uh.edu; Sat, 23 Aug 2014 22:19:55 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1XLOLQ-00055Z-4g for ding@gnus.org; Sun, 24 Aug 2014 05:19:52 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XLOLQ-0005mZ-2h for ding@gnus.org; Sun, 24 Aug 2014 05:19:52 +0200 Original-Received: from 114.248.6.55 ([114.248.6.55]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Aug 2014 05:19:52 +0200 Original-Received: from eric by 114.248.6.55 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 24 Aug 2014 05:19:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 114.248.6.55 User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:lNcAet6vtnonAzg5LdUNyDUBVug= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84809 Archived-At: Christopher Culver writes: > Eric Abrahamsen writes: >> In gnus-sum.el there are a series of `gnus-data-*' functions for >> working with the data vector, there's a `gnus-data-number', for >> instance. Of course, all that does is take the car of the vector! But >> if you're doing more than that, it's probably better to use the >> pre-made functions. > > How does one use that? To save the article number as a variable specific > to the function I’m writing, I had (defvar the-article-number (aref > data-header 0)), which works. However, changing that to > (gnus-data-number data-header) gives an error. Huh, that's weird, I don't see why (aref ARRAY 0) would be any different from (car ARRAY)... What error do you get? > The problem now with my function is that gnus-article-move-hook is > apparently called *after* the message has been totally moved from the > group in question and deleted from the summary buffer. Without the > article still present in the summary buffer, I cannot use the following > functions that I had expected to: > > (gnus-summary-goto-subject the-article-number) > (gnus-summary-save-in-pipe "my-piped-command" t) > > Trying to use those functions results in the following error message: > > No such file: /home/crculver/Mail/mail/misc/54433 > No such article (may have expired or been canceled) > > Does Gnus have a way of accessing messages in other groups than what is > visible in the summary buffer? Of course, the article number will change in > the group to which the message is moved. > > Or is there a way to run the gnus-article-move-hook function *prior* to > the moving of the message? There are several dynamic variables bound during `gnus-summary-move-article' that you might be able to use. In the message moving loop, the variables to-group and to-article *ought* to be bound to the destination group, and the message's new article number in that group. Maybe try using those variables in your hook function to find the article at its new location? HTH, Eric