I really liked the new slime translation stuff that went in a few days ago... except that tramp is a little bit different on xemacs.
Part of it though, tramp has lots of functions for manipulating filenames. If we are going to depend on tramp for this feature, the automatic creation of translation functions, then lets use the tramp stuff that already has this configuration and functions built in.
Here is a lisp paste showing what can be done with the new configuration. http://paste.lisp.org/display/17592
If you like, I can go link this from Cliki as well.
Nathan Bird nathan@acceleration.net
? foo.el ? swank-loader.fas ? swank-loader.lib Index: ChangeLog =================================================================== RCS file: /project/slime/cvsroot/slime/ChangeLog,v retrieving revision 1.852 diff -u -r1.852 ChangeLog --- ChangeLog 4 Mar 2006 20:13:25 -0000 1.852 +++ ChangeLog 7 Mar 2006 04:46:46 -0000 @@ -1,3 +1,8 @@ +2006-03-06 Nathan Bird nathan@acceleration.net + + * slime.el: (slime-create-filename-translator): use the tramp + methods for dissecting and building filenames. + 2006-03-04 Wojciech Kaczmarek wojtekk@kofeina.net
* slime.el (slime-filename-translations): Typo in example. Index: slime.el =================================================================== RCS file: /project/slime/cvsroot/slime/slime.el,v retrieving revision 1.593 diff -u -r1.593 slime.el --- slime.el 4 Mar 2006 20:13:51 -0000 1.593 +++ slime.el 7 Mar 2006 04:46:49 -0000 @@ -1285,7 +1285,7 @@ remote-host username) "Creates a three element list suitable for push'ing onto -slime-filename-translations which uses tramp to load files on +slime-filename-translations which uses Tramp to load files on hostname using username. MACHINE-INSTANCE is a required parameter, REMOTE-HOST defaults to MACHINE-INSTANCE and USERNAME defaults to (user-login-name). @@ -1294,23 +1294,20 @@ which is just the value returned by cl:machine-instance on the remote lisp. REMOTE-HOST is the fully qualified domain name (or just the IP) of the remote machine. USERNAME is the username we -sholud login with." - (setf remote-host (or remote-host machine-instance) - username (or username (user-login-name))) - (lexical-let ((tramp-prefix (concat "/ssh:" username "@" remote-host ":"))) +should login with. +The functions created here expect your tramp-default-method or + tramp-default-method-alist to be setup correctly." + (lexical-let ((remote-host (or remote-host machine-instance)) + (username (or username (user-login-name)))) (list (concat "^" machine-instance "$") - `(lambda (emacs-filename) - (subseq emacs-filename (length ,tramp-prefix))) + (lambda (emacs-filename) + (tramp-file-name-localname + (tramp-dissect-file-name emacs-filename))) `(lambda (lisp-filename) - (concat ,tramp-prefix lisp-filename))))) - -(defun* slime-add-filename-translation (&key machine-instance - remote-host - username) - (push (slime-create-filename-translator :machine-instance machine-instance - :remote-host remote-host - :username username) - slime-filename-translations)) + (tramp-make-tramp-file-name nil + ,username + ,remote-host + lisp-filename)))))
;;;; Starting SLIME