Gnus development mailing list
 help / color / mirror / Atom feed
* macro within interactive form isn't expanded
@ 2008-09-10  1:03 Katsumi Yamaoka
  0 siblings, 0 replies; only message in thread
From: Katsumi Yamaoka @ 2008-09-10  1:03 UTC (permalink / raw)
  To: emacs-devel, ding

Hi,

(Bcc'd to Iain Dalton)

Iain Dalton reported to the <bugs@gnus.org> list and I confirmed
that performing the `gnus-group-make-useful-group' command causes
an error as follows:

list: Symbol's function definition is void: caddr

Note that it is not due to not having compiled gnus-group.el.
It happens with the byte compiled Gnus that is distributed with
Emacs 22.1, 22,2, and 22.3.  So is the one compiled with 23.0.60.

The form (caddr X) should be expanded into (car (cdr (cdr X)))
when compiling, however I realized today that macros within the
`interactive' form will be neither expanded nor compiled.  For
instance:

(defmacro foo (x) x)
(byte-compile (lambda (x) (interactive (list (foo x)))))
 => #[(x) "\300\207" [nil] 1 nil (list (foo x))]

(require 'cl)
(load "cl-macs")
(byte-compile (lambda (x) (interactive (list (caddr x)))))
 => #[(x) "\300\207" [nil] 1 nil (list (caddr x))]

But macro outside `interactive' is compiled as follows:

(disassemble (byte-compile (lambda (x) (caddr x))))
 => byte code:
      args: (x)
    0       varref    x
    1       dup
    2       varbind   x
    3       cdr
    4       cdr
    5       unbind    1
    6       car
    7       return

Shouldn't it be documented somewhere?  Or only I didn't know it?
Though there may also be similar problems in interactive functions
other than `gnus-group-make-useful-group', I will replace `caddr'
in it with the expanded form anyway.

BTW, is there a better way than loading cl for Iain Dalton?

Regards,




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-10  1:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-10  1:03 macro within interactive form isn't expanded Katsumi Yamaoka

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