Gnus development mailing list
 help / color / mirror / Atom feed
* how to turn this Gnus function into a macro?
@ 2004-01-07 22:19 Ted Zlatanov
  2004-01-07 22:55 ` Jesper Harder
  2004-01-08  2:13 ` Katsumi Yamaoka
  0 siblings, 2 replies; 12+ messages in thread
From: Ted Zlatanov @ 2004-01-07 22:19 UTC (permalink / raw)


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)))))



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-01-08 20:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-07 22:19 how to turn this Gnus function into a macro? Ted Zlatanov
2004-01-07 22:55 ` Jesper Harder
2004-01-08  0:09   ` Ted Zlatanov
2004-01-08  4:13     ` Jesper Harder
2004-01-08  2:13 ` Katsumi Yamaoka
2004-01-08  3:28   ` Ted Zlatanov
2004-01-08  3:33     ` Katsumi Yamaoka
2004-01-08  3:42     ` Jeremy Maitin-Shepard
2004-01-08  3:47       ` Katsumi Yamaoka
2004-01-08  4:06         ` Jeremy Maitin-Shepard
2004-01-08  6:06         ` Katsumi Yamaoka
2004-01-08 20:30           ` Ted Zlatanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).