From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84790 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: Mon, 18 Aug 2014 22:25:36 +0800 Message-ID: <87mwb1lvrz.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> 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 1408371720 10013 80.91.229.3 (18 Aug 2014 14:22:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Aug 2014 14:22:00 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M33033@lists.math.uh.edu Mon Aug 18 16:21:53 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 1XJNol-00041g-VS for ding-account@gmane.org; Mon, 18 Aug 2014 16:21:52 +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 1XJNoX-0000YQ-Ir; Mon, 18 Aug 2014 09:21:37 -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 1XJNoV-0000Y7-UH for ding@lists.math.uh.edu; Mon, 18 Aug 2014 09:21:35 -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 1XJNoU-0002FX-St for ding@lists.math.uh.edu; Mon, 18 Aug 2014 09:21:35 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1XJNoT-00014H-JB for ding@gnus.org; Mon, 18 Aug 2014 16:21:33 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XJNoN-0003nA-SG for ding@gnus.org; Mon, 18 Aug 2014 16:21:27 +0200 Original-Received: from 111.197.165.79 ([111.197.165.79]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Aug 2014 16:21:27 +0200 Original-Received: from eric by 111.197.165.79 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 18 Aug 2014 16:21:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 111.197.165.79 User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:2WiOfC9p5by9JtqJ+vgpk1NWoLs= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84790 Archived-At: Christopher Culver writes: > Eric Abrahamsen writes: >> Hmm, it is a little unfortunate that the docstrings of those hooks don't >> say... Both of them are called with the same arguments: ACTION (which >> can be a symbol like move, delete, crosspost, or copy), DATA (which is >> the header data as returned by `gnus-data-header'), FROM-GROUP (where >> the article's coming from), TO-GROUP (where it's going), and >> SELECT-METHOD, for the current select method. > > Strange, I would have expected one of the arguments to be the article > itself, not just the header. If I want a function called by a hook to do > something with the raw article, how can I get the raw article passed to > the function? Or can I simply call gnus-summary-save-in-pipe from within > the function and it would know to act on the article(s) presently being > moved or deleted? My knowledge of Emacs Lisp is still rudimentary and > maybe I don’t understand the scoping. > > Christopher Culver Actually the data argument should be all you need. It will contain several of the important email headers from the message, if that's good enough, and that it isn't good enough, it also contains the article number, which is all you need to retrieve the whole article. Part of the confusing thing about this is that it's hard to tell what "the article" actually is. As far as Gnus is concerned, the article number is the important thing. But when you say you want the "raw article" passed to the function, what does that mean, exactly? A buffer holding the article? The article as a string? Practically speaking, you can use that data to do pretty much anything you wanted to do with the article. I know that's not that helpful... Eric