Executing Emacs Lisp code from Common Lisp? 
Author Message
 Executing Emacs Lisp code from Common Lisp?

    In Allegro Lisp, the Emacs-Lisp interface allows one to evaluate CL
forms from within an Emacs Lisp function with the command

    fi:eval-in-lisp

    I am trying to do just the opposite: evaluate some Emacs Lisp code
from within a Common Lisp program.

    Specifically, I am writing an application, one of whose purposes is
to compute some Emacs Lisp code which performs a modification to each
file in a subdirectory tree, according to certain rules. My CL object
computes a list of a bunch of Emacs Lisp forms, each of which look
something like the following:

(let ((buffer "foo.lisp")

      (file  "/goo/bar/foo.lisp")

      (package ":mypackage"))

  (find-file file)

  (set-buffer buffer)

  (set-package package)

  (save-buffer)

  (kill-buffer buffer))

I can happily copy and paste this code to an Emacs *scratch* buffer and
evaluate it, and it performs exactly as desired. Or I can save it to a
file and load-file the file in emacs, and it performs as desired.

But what I really want to do is automatically call across the Emacs-Lisp
interface from CL into Emacs, and cause the Emacs process to evaluate
the form (kind of making Emacs be the server and CL be the client).

This must be possible, because the ICAD defpart browser has certain
features where you can select things with the mouse and cause files to
be visited in Emacs, and bring the Emacs window into the current
workspace, etc.  Anyone have a clue as to how do they do that?

--
David J Cooper Jr                                       Genworks International

 ...Embracing an Open Systems Approach to Knowledge-based Engineering...



Thu, 24 Aug 2000 03:00:00 GMT  
 Executing Emacs Lisp code from Common Lisp?


Quote:

>     In Allegro Lisp, the Emacs-Lisp interface allows one to evaluate CL
> forms from within an Emacs Lisp function with the command

>     fi:eval-in-lisp

>     I am trying to do just the opposite: evaluate some Emacs Lisp code
> from within a Common Lisp program.

LEP::EVAL-IN-EMACS, takes a string like (lep::eval-in-emacs
"(buffer-name (current-buffer))").


Fri, 25 Aug 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Running Koza's GP1 Lisp code on Common Lisp

2. Running Koza's GP1 Lisp code on Common Lisp

3. What I want from my Common Lisp vendor and the Common Lisp community

4. New Common Lisp, Lisp-to-C translation, Lisp library for C

5. lucid common lisp -- C -- Common lisp intercallability

6. Lucid (Sun) Common Lisp vs Allegro (Franz) Common Lisp - the Summary

7. Lucid (Sun) Common Lisp vs Allegro (Franz) Common Lisp

8. Sun Common Lisp vs. Allegro Common Lisp

9. integrating common lisp code with c++ code

10. Syntax highlighting for Common Lisp in (X)Emacs

11. Common lisp with emacs

12. emacs vs common lisp

 

 
Powered by phpBB® Forum Software