[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fix for XEmacs, session support for plink

From: Pete Forman
Subject: fix for XEmacs, session support for plink
Date: Wed, 16 Dec 2009 09:32:31 -0000
User-agent: Opera Mail/10.10 (Win32)

I've made 3 changes to tramp.el.  The important one is to make it work
with XEmacs.  The other 2 changes are to support sessions in plink.  A
session is a set of parameters including user name, host, connection
settings and environment variables.  I see that there is now a plinkx
tramp method doing approximately the same.

1) Add plinks

This is similar to plinkx but without the env.  I handle environment
variables in my PuTTY session settings.

2) Fix incompatibility with XEmacs dired-uncache

In XEmacs 21.5.29 dired-uncache takes 2 args.  I've made the second
arg optional so it should be good for other emacsen.

3) tramp-compute-multi-hops to work with plinks method

Here's the patch.

--- tramp.el.orig       2009-12-14 10:22:18.000000000 +0000
+++ tramp.el    2009-12-14 15:49:39.687500000 +0000
@@ -593,6 +593,18 @@
          (tramp-copy-args            nil)
          (tramp-copy-keep-date       nil)
          (tramp-password-end-of-line nil))
+    ("plinks"
+     (tramp-login-program "plink")
+     (tramp-login-args
+      (("-load" "%h")
+       ("-P" "%p")
+       ("-ssh")))
+     (tramp-remote-sh "/bin/sh")
+     (tramp-copy-program nil)
+     (tramp-copy-args nil)
+     (tramp-copy-keep-date nil)
+     (tramp-password-end-of-line "xy")
+     (tramp-default-port 22))
     ("pscp"  (tramp-login-program        "plink")
          (tramp-login-args           (("%h") ("-l" "%u") ("-P" "%p")
@@ -3241,7 +3253,7 @@
                           (tramp-shell-quote-argument localname)
                           (tramp-shell-quote-argument filename)
                           (if (symbol-value
-                   'read-file-name-completion-ignore-case)
+                   'completion-ignore-case)
                   1 0)))

               (format (concat
@@ -3972,7 +3984,7 @@
             (concat file ".z"))
                (t nil)))))))))

-(defun tramp-handle-dired-uncache (dir)
+(defun tramp-handle-dired-uncache (dir &optional dir-p) ;; XEmacs needs 2 args
   "Like `dired-uncache' for Tramp files."
   (with-parsed-tramp-file-name dir nil
     (tramp-flush-file-property v localname)))
@@ -7023,6 +7035,10 @@
        ;; The host name is used for the remote shell command.
         '("%h") (tramp-get-method-parameter method 'tramp-login-args))
+       ;; The host name is used by plink as the name of a session.
+       (member
+        '("-load" "%h")
+            (tramp-get-method-parameter method 'tramp-login-args))
        ;; The host is local.  We cannot use `tramp-local-host-p'
        ;; here, because it opens a connection as well.
        (string-match tramp-local-host-regexp host))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]