[slime-devel] Re: Serverside Sources

Helmut Eller heller at common-lisp.net
Tue Jul 29 10:30:21 UTC 2008


* Dr. Helmut G. Enders [2008-07-26 10:12+0200] writes:

> I'm looking for a solution, to keep the source files
> locally, on my laptop (near my emacs).

If you just need a webserver on the remote machine, I would recommend to
install a webserver on the laptop and to develop most of the time on the
laptop only.  Put the source files under something like CVS and use that
for synchronization.

> Do you see a chance that after ^c-^k th remote lisp requests
> the source file via the slime protocol from my local
> laptop.

Not without changing/extending SLIME.

Instead of slime-compile-file you could use slime-compile-region (on the
entire buffer).  This doesn't copy the file to the remote machine but
M-. etc. should work as long as the buffer exists.

If you don't mind to change SLIME, you could create a command which
copies the file, either with scp or via SLIME's connection, before
calling slime-compile-file.  Additionally you can set
slime-from-lisp-filename-function and slime-to-lisp-filename-function so
that the Lisp side loads the remote copy but reports compiler messages
etc. on the local file.  

If the filename translation functions are setup properly, the following 
should work:


(defun my-compile-file ()
  (interactive)
  (slime-eval `(swank:overwrite-file 
		,(slime-to-lisp-filename (buffer-file-name))
		,(buffer-substring-no-properties (point-min) (point-max))))
  (slime-compile-and-load-file))



(swank::defslimefun swank::overwrite-file (filename string)
  (with-open-file (stream filename :direction :output 
			  :if-exists :supersede 
			  :if-does-not-exist :create)
    (write-sequence string stream)
    (finish-output stream))
  t)



Helmut.




More information about the slime-devel mailing list