emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

macro within interactive form isn't expanded


From: Katsumi Yamaoka
Subject: macro within interactive form isn't expanded
Date: Wed, 10 Sep 2008 10:03:57 +0900
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

Hi,

(Bcc'd to Iain Dalton)

Iain Dalton reported to the <address@hidden> 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,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]