From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/55816 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: how to turn this Gnus function into a macro? Date: Wed, 07 Jan 2004 17:19:15 -0500 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: ding-owner@lists.math.uh.edu Message-ID: <4noetfo10c.fsf@collins.bwh.harvard.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1073514042 11735 80.91.224.253 (7 Jan 2004 22:20:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2004 22:20:42 +0000 (UTC) Original-X-From: ding-owner+M4356@lists.math.uh.edu Wed Jan 07 23:20:39 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 1AeM2Z-0002T8-00 for ; Wed, 07 Jan 2004 23:20:39 +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 1AeM2S-0001kh-00; Wed, 07 Jan 2004 16:20:32 -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 1AeM2N-0001kY-00 for ding@lists.math.uh.edu; Wed, 07 Jan 2004 16:20:27 -0600 Original-Received: from clifford.bwh.harvard.edu (clifford.bwh.harvard.edu [134.174.9.41]) by justine.libertine.org (Postfix) with ESMTP id A7EE13A004E for ; Wed, 7 Jan 2004 16:20:26 -0600 (CST) Original-Received: from collins.bwh.harvard.edu (collins [134.174.9.80]) by clifford.bwh.harvard.edu (8.10.2+Sun/8.11.0) with ESMTP id i07MJMW00784 for ; Wed, 7 Jan 2004 17:19:22 -0500 (EST) Original-Received: from collins.bwh.harvard.edu (localhost [127.0.0.1]) by collins.bwh.harvard.edu (8.12.9+Sun/8.11.0) with ESMTP id i07MJGuB026592 for ; Wed, 7 Jan 2004 17:19:16 -0500 (EST) Original-Received: (from tzz@localhost) by collins.bwh.harvard.edu (8.12.9+Sun/8.12.9/Submit) id i07MJGil026589; Wed, 7 Jan 2004 17:19:16 -0500 (EST) Original-To: Ding Mailing List X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Followup-To: Ding Mailing List User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (usg-unix-v) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:55816 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:55816 I tried to make this function into a macro but failed. Any help will be greatly appreciated. As it is it works, so it's not a big deal but I'm curious what I missed. The Emacs docs on macros are pretty bad, and my problem boiled down to being unable to (funcall) a macro by name. Thanks Ted (defun spam-fetch-field-fast (article field) "Fetch a field quickly, using the internal gnus-data-list function" (when (numberp article) (let* ((header (assoc article (gnus-data-list nil))) (data-header (if header (gnus-data-header header) nil))) (cond ((equal field 'from) (mail-header-from data-header)) ((equal field 'message-id) (mail-header-message-id data-header)) ((equal field 'subject) (mail-header-subject data-header)) ((equal field 'references) (mail-header-references data-header)) ((equal field 'date) (mail-header-date data-header)) ((equal field 'xref) (mail-header-xref data-header)) ((equal field 'extra) (mail-header-extra data-header)) (t nil)))))