[slime-devel] Loading slime for clisp in xemacs on Windows

Reini Urban rurban at x-ray.at
Thu Sep 30 16:29:59 UTC 2004


Andrei Stebakov schrieb:

> Hi,
> 
> I have xemacs and clisp that came with the cygwin distribution.
> I just downloaded slime-1.0 and put the following in my custom.el file:
> 
> (add-to-list 'load-path "C:\\Linux\\slime-1.0\\")
> (add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
> (add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))
> (setq inferior-lisp-program "clisp -K full")
> (require 'slime)
> (slime-setup)
> 
> Now, when I load slime (via M-x slime) I got:
> [1]> 
> *** - PARSE-NAMESTRING: syntax error in filename
> "c:\\Linux\\slime-1.0\\swank-loader.lisp" at position 2
> Break 1 [2]> 
> *** - READ from #<IO TERMINAL-STREAM>: there is no package with name "SWANK"
> Break 2 [3]> 
> "C:\\DOCUME~1\\stebakov\\LOCALS~1\\Temp\\slime.2036"
> Break 2 [3]> 
> 
> Could anyone give me some info what I can do to fix it?

You have to translate the filenames between windows xemacs and
clisp if cygwin.

I tried to post my cygmount fixes here, but it didn't get through.
So I post the url instead:
http://xarch.tu-graz.ac.at/autocad/lsp_tools/ntemacs/cygwin32-mount.el


.emacs:
;; SLIME load-path
(if (eq system-type 'windows-nt)
     (add-to-list 'load-path (concat invocation-directory 
"..\\..\\site-packages\\lisp\\slime"))
     (add-to-list 'load-path "/usr/share/xemacs/site-packages/lisp/slime"))
(require 'easy-mmode)
(defalias 'define-minor-mode 'easy-mmode-define-minor-mode)
(if (require 'slime)
     (slime-setup))
(if (eq system-type 'windows-nt)
   (setq inferior-lisp-program "n:/bin/clisp.exe -K full -ansi -q -L 
ENGLISH -N locale -Efile UTF-8 -Eterminal UTF-8"
	;swank-backend "/cygwin/w/XEmacs/site-packages/lisp/slime/swank-loader"
	)
   ;; (setq inferior-lisp-program 
"R:\\lisp\\clisp\\clisp-2.33-win\\clisp.bat -ansi -q -L ENGLISH -Efile 
UTF-8 -Eterminal UTF-8")
   (setq inferior-lisp-program "/usr/local/bin/clisp-full"
	;swank-backend "/cygdrive/w/XEmacs/site-packages/lisp/slime/swank-loader"
	))
(require 'cygwin32-mount)
(require 'npak-cygwin)
(defun myslime-cygwin-filename (filename)
   (if (eq system-type 'windows-nt) ; and lisp is cygwin
       (npak-cygwin-fix-file-name
        (replace-in-string filename "//c/" ""
			  (replace-in-string filename "\\\\" "/")))
       filename))
;;(setq filename "w:\\XEmacs\\site-packages\\lisp\\slime\\swank-loader")
(defun myslime-translate-to-lisp-filename-function (fn)
   (let ((x
	(if (eq system-type 'windows-nt) ; and lisp is cygwin
	    (cygwin32-mount-name-expand #'identity filename)
					;(replace-in-string filename "//c/" ""
;					       (replace-in-string filename "\\\\" "/"));)
	    filename)))
     (message x)
     x))
(defun myslime-translate-from-lisp-filename-function (filename)
   (let ((x
	 (if (eq system-type 'windows-nt) ; and lisp is cygwin
	     (cygwin32-mount-name-reverse #'identity filename)
	     ;;(npak-cygwin-fix-file-name (replace-in-string filename "\\\\" "/"))
	     filename)))
     (message x)
     x))
;(setq inferior-lisp-program-type 'cygwin)


I finished now filename conversion from win32 <=> cygwin in slime.el,
which is a major hackery.
   parsing the output of mount, table lookup. based on cygwin32-mount.el

The problem remains:

slime.el easily detects if emacs is win32 native or cygwin or unix.
but how does it detect under which OS/Filesystem convention the inferior 
lisp will run?
how to get the mounttable of the filesystem of the lisp?

should we add a inferior-lisp-ostype defcustom?
should be parse the output of the startup banner to detect the 
filesystem convention?
   "loading /home/...."

for example w32 emacs calling a linux acl,
w32 emacs calling cygwin clisp,
w32 emacs calling w32 clisp,
cygwin xemacs calling w32 clisp, ...
you get the idea. I also want to switch between clisp cygwin and clisp 
native. (better GC)

If we add that feature, we can at least use automatic cygwin path 
translation.
See the attachment:
   It is also a good example how to translate with a mount table alist.

The real pain was that latest clisp (CVS) doesn't understand these 
filenames anymore:
   (LOAD "w:/XEmacs/site-packages/lisp/slime/swank-loader")
It has to be translated to
   (LOAD "/cygdrive/w/XEmacs/site-packages/lisp/slime/swank-loader")

Another problem on clisp with cygwin/w32 switching:
the fas files are incompatible, but the temp path is the same. I'd like 
to add the ostype to the path on clisp.
no patches yet.

-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/




More information about the slime-devel mailing list