help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: On definition of `kbd'


From: Herbert Euler
Subject: Re: On definition of `kbd'
Date: Wed, 11 Oct 2006 21:55:36 +0800

Have changed to "help-gnu-emacs".  So, is this usage
of macro only suitable for cases the actual arguments
are constants?  I.e.

(let ((x "x")) (kbd x))

will not pass compilation?

Thanks.

Regards,
Guanpeng Xu


From: David Kastrup <dak@gnu.org>
To: "Herbert Euler" <herberteuler@hotmail.com>
CC: emacs-devel@gnu.org
Subject: Re: On definition of `kbd'
Date: Wed, 11 Oct 2006 13:16:15 +0200

"Herbert Euler" <herberteuler@hotmail.com> writes:

> I find definition of `kbd' is:
>
>   (defmacro kbd (keys)
>     "Convert KEYS to the internal Emacs key representation.
>   KEYS should be a string constant in the format used for
>   saving keyboard macros (see `edmacro-mode')."
>     (read-kbd-macro keys))
>
> This would cause problem when evaluating
>
>  (kbd (car list))
>
> where the `car' of a list is a key sequence text.

In this case, KEYS is the list `(car list)' and not a string constant.

> Is the definition correct?  I think the body should be
>
>  `(read-kbd-macro ,keys)

That would completely defeat the purpose of having a macro, namely
being able to do compile-time evaluation.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/





reply via email to

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