From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kalle Olavi Niemitalo To: guile-emacs@sourceware.cygnus.com Subject: Re: import-lisp-macro Date: Mon, 20 Mar 2000 07:50:00 -0000 Message-id: <87puspfxy5.fsf@PC486.Niemitalo.LAN> References: X-SW-Source: 2000-q1/msg00044.html The current version (emacs.scm 1.3) of import-lisp-macro can't handle this: (let ((msg "Hello!")) (save-excursion msg)) because it evaluates the lambda in the wrong place. The following definition seems to work better. I moved most of the code emitted by the macro to a new function "call-lisp-macro" because nested backquotes confuse me. There is still some nesting; I hope I got it right. I am currently unable to access SourceForge via SSH so please commit this change for me. (You could use this mail as the log message. :-) ) (define-private (call-lisp-macro macro-name thunk) (lispref->scm (lisp-eval `(,macro-name (scheme-eval '(',thunk)))))) (define-macro (import-lisp-macro macro . rest) (let ((scheme-name (if (pair? rest) (car rest) macro))) `(define-macro (,scheme-name . body) `(',',call-lisp-macro ',',macro (lambda () ,@body))))) (export import-lisp-macro)