[slime-devel] slime-create-filename-translator revisted.

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

Nathan Bird <nathan@acceleration.net> writes:
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
applied. thanks. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen

It looks like the patch got applied to the ChangeLog: http://common-lisp.net/cgi-bin/viewcvs.cgi/slime/ChangeLog?root=slime&r1=1.8 52&r2=1.853 But not the slime.el file: http://common-lisp.net/cgi-bin/viewcvs.cgi/slime/slime.el?rev=1.593&root=sli me&view=log Did I not create the patch correctly? I was just able to apply it... Well, looking back at it, it seems that the previous patch accidentally removed the helper function: slime-add-filename-translation. This patch is also slightly different in that I added "(require 'tramp)" to the function which requires tramp. I tested reverting slime.el and applying this patch, everything seems to work. Nathan Bird -----Original Message----- From: slime-devel-bounces@common-lisp.net [mailto:slime-devel-bounces@common-lisp.net] On Behalf Of Nathan Bird Sent: Tuesday, March 07, 2006 12:06 AM To: slime-devel@common-lisp.net Subject: [slime-devel] slime-create-filename-translator revisted. 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

"Nathan Bird" <nathan@acceleration.net> writes:
Did I not create the patch correctly? I was just able to apply it...
my bad, i botched the commit. -- -Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen
participants (2)
-
Marco Baringer
-
Nathan Bird