From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/55826 Path: main.gmane.org!not-for-mail From: Jeremy Maitin-Shepard Newsgroups: gmane.emacs.gnus.general Subject: Re: how to turn this Gnus function into a macro? Date: Wed, 07 Jan 2004 22:42:54 -0500 Sender: ding-owner@lists.math.uh.edu Message-ID: <87k743qf5t.fsf@jbms.ath.cx> References: <4noetfo10c.fsf@collins.bwh.harvard.edu> <4n8ykjazla.fsf@collins.bwh.harvard.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1073533230 13131 80.91.224.253 (8 Jan 2004 03:40:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Jan 2004 03:40:30 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+M4366@lists.math.uh.edu Thu Jan 08 04:40:27 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeR23-0001zQ-00 for ; Thu, 08 Jan 2004 04:40:27 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1AeR1s-0003GJ-00; Wed, 07 Jan 2004 21:40:16 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1AeR1n-0003GE-00 for ding@lists.math.uh.edu; Wed, 07 Jan 2004 21:40:11 -0600 Original-Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by justine.libertine.org (Postfix) with ESMTP id E9EF63A005B for ; Wed, 7 Jan 2004 21:40:10 -0600 (CST) Original-Received: from jay.local.invalid (h00105aa5eefe.ne.client2.attbi.com[24.91.123.131]) by comcast.net (rwcrmhc13) with ESMTP id <2004010803401001500cvsaue>; Thu, 8 Jan 2004 03:40:10 +0000 Original-Received: by jay.local.invalid (Postfix, from userid 1000) id D189222A402; Wed, 7 Jan 2004 22:42:54 -0500 (EST) Original-To: Katsumi Yamaoka In-Reply-To: <4n8ykjazla.fsf@collins.bwh.harvard.edu> (Ted Zlatanov's message of "Wed, 07 Jan 2004 22:28:17 -0500") User-Agent: Gnus/5.1005 (Gnus v5.10.5) Emacs/21.3.50 (gnu/linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:55826 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:55826 Ted Zlatanov writes: > [snip] > Your solution still has a special case for every field - I was hoping > that given ARTICLE and 'from as the arguments, the macro would > call (mail-header-from ARTICLE) for example. > [snip] This should do the trick: (defmacro spam-fetch-field-fast (article field) "Fetch a field quickly, using the internal gnus-data-list function" (let ((macro (intern (concat "mail-header-" (symbol-name field))))) (if macro `(let ((article ,article)) (if (numberp article) (let* ((header (assoc article (gnus-data-list nil))) (data-header (if header (gnus-data-header header)))) (,macro data-header))))))) -- Jeremy Maitin-Shepard