[slime-devel] Re: small patch to slime-xref-quit & feature request.

Eduardo Muñoz emufer at terra.es
Mon Apr 4 17:19:00 UTC 2005


* Helmut Eller <heller at common-lisp.net>
| Eduardo Muñoz <emufer at terra.es> writes:
| 
| > The feature request is to send more arguments to
| > slime-translate-to-lisp-filename-function and her sister
| > slime-translate-from-lisp-filename-function, say
| > (lisp-implementation-version) and (machine-instance). I am
| > no elisp expert and failed to work out something like
| > this. The idea is to be able to know if the translation is
| > really needed (emacs on windows, lisp on linux) or not
| > (everything on linux). The easy part is to know where emacs
| > is running and the hard one (that I leave to fine slime
| > hackers :) is to know the lisp host environment.
| 
| I've added elisp functions slime-lisp-implementation-version and
| slime-machine-version.  The values are initialized at startup.

Thank for the change.

| Btw, you could have used something like 
|   
|   (slime-eval '(cl:lisp-implementation-version))
|   ...

I could had I know that it existed. I was not evident how to
implement this functionality with my knowledge of slime
protocols (almost zilch) and elisp. So thanks again for
implementing this feature. :)

For the curious here are the functions that I use in its
final state: 

(defun emacs-running-on-windows ()
  (string-match "\\(somehost\\|otherhost\\)" (system-name)))

(defun lisp-running-on-linux ()
  (string-match "\\(|lispserver\\foobar\\)" (slime-machine-instance)))

(defun my-translate-to-lisp (here)
  ;; from e:/ to /home/emf/
  (if (and (emacs-running-on-windows)
           (lisp-running-on-linux))
      ;; subseq strips drive letter & colon
      (concat "/home/emf/" (subseq here 3))
    here))

(defun my-translate-from-lisp (there)
  ;; viceversa
  (if (and (emacs-running-on-windows)
           (lisp-running-on-linux))
      (concat "e:/" (subseq there (length "/home/emf/")))
    there))

(setq slime-translate-to-lisp-filename-function  'my-translate-to-lisp
      slime-translate-from-lisp-filename-function 'my-translate-from-lisp)


-- 
Eduardo Muñoz          | (prog () 10 (print "Hello world!")
http://213.97.131.125/ |          20 (go 10))




More information about the slime-devel mailing list