Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: emacs-devel@gnu.org, ding@gnus.org
Subject: macro within interactive form isn't expanded
Date: Wed, 10 Sep 2008 10:03:57 +0900	[thread overview]
Message-ID: <b4mljy0n75u.fsf@jpl.org> (raw)

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,




                 reply	other threads:[~2008-09-10  1:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mljy0n75u.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).