#Q 4.1-1) How do I print to the emacs-lisp interface created
*common-lisp* buffer when I run my application in its own Lisp image?
#Q 4.1-2) Can I connect a UNIX emacs to a Windows Lisp?
#Q 4.1-3) Can I run Emacs on Windows and Lisp on UNIX?
#Q 4.1-4) Why doesn't the emacs-lisp interface startup when I don't have a
network connection?
Q 4.1-1) How do I print to the emacs-lisp interface created *common-lisp* buffer when I run my application in its own Lisp image?
A 4.1-1) You can do this by fwrapping on the function excl:start-emacs-lisp-interface. The fwrap should be in place at the time the emacs-lisp interface is started, which means you will have to make a new Lisp image.
For example, put the following into a file, say /tmp/test.cl:
(in-package :user)
(def-fwrapper print-wrap (&rest args)
(declare (ignore args))
(call-next-fwrapper)
(sleep 3)
(let* ((proc (multiprocessing:process-name-to-process
#+mswindows "*common-lisp*"
#-mswindows "Initial Lisp Listener"))
(stream
#+mswindows
(mp::symeval-in-process '*standard-output* proc)
#-mswindows
(mp::symeval-in-stack-group
'*standard-output*
(mp::process-stack-group proc))))
(format stream "The emacs-lisp interface has started...~%")
(force-output stream)))
(fwrap 'excl:start-emacs-lisp-interface 'eli-startup-print 'print-wrap)
start up Lisp and do this (you will likely see different prompt numbers, of course):
user(7): :cl /tmp/test.cl user(8): (dumplisp :name "/tmp/test.dxl")
When you start up Lisp with the test.dxl image you just created, by using M-x fi:common-lisp, and specifying /tmp/test.dxl as the imag, you will then see
The emacs-lisp interface has started...
in the *common-lisp* buffer.
Q 4.1-2) Can I connect a UNIX emacs to a Windows Lisp?
A 4.1-2) Yes, as follows:
(excl:start-emacs-lisp-interface)
M-x set-variable RET fi:connect-to-windows RET tM-x fi:common-lisp RET RET <specify windows host> RET ...
You should now be connected to the Lisp running on Windows.
Q 4.1-3) Can I run Emacs on Windows and Lisp on UNIX?
A 4.1-3) No. The emacs-lisp interface does not currently support this.
Q 4.1-4) Why doesn't the emacs-lisp interface startup when I don't have a network connection?
A 4.1-7) Typically this is a not a problem on Unix, so we will discuss how to deal with this on Windows (but the Unix solution is similar).
The short answer is the startup is failing because the emacs-lisp interface does a lookup on the host localhost, looking in a Windows hosts file for a translation of localhost. If such a translation cannot be found, either because there is no hosts file or the hosts file does not contain a translation for localhost (to 127.0.0.1), then the ELI function fi:common-lisp will fail to startup lisp.
You can check if you have this problem by typing
ping localhost
to a DOS prompt or a Command prompt: If the result is a message like host localhost not found, then you will not be able to use fi:common-lisp without further work.
There are two solutions:
127.0.0.1 localhost
There is a TAB between 127.0.0.1 and localhost. The <Windows directory> is often c:\windows\ but may be different on your machine.
(setq fi:common-lisp-host "127.0.0.1")
© Copyright 1999, 2001, Franz Inc., Berkeley, CA. All rights reserved.
$Revision: 1.1.2.2.12.1 $