Merge remote-tracking branch 'crybaby'
authorMark Wooding <mdw@distorted.org.uk>
Sun, 5 Jun 2011 01:44:21 +0000 (02:44 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 5 Jun 2011 01:44:21 +0000 (02:44 +0100)
* crybaby:
  dot/emacs: Tramp hacking: use `sudo', and set up magic proxies.

dot/emacs

index 8832f3f..5081daf 100644 (file)
--- a/dot/emacs
+++ b/dot/emacs
               (tramp-remote-sh "/bin/sh"))
              ,@tramp-methods)))
      (setq tramp-default-method "ssh")
-     (setq tramp-default-method-alist
-          `(("\\`\\(localhost\\|\\)\\'" ""
-             ,(cond ((executable-find "really") "really")
-                    ((executable-find "become") "become")
-                    ((executable-find "sudo") "sudo")
-                    (t "su")))))))
+     (let ((rootlyness (cond ((executable-find "really") "really")
+                            ((executable-find "become") "become")
+                            ((executable-find "sudo") "sudo")
+                            (t "su"))))
+       (setq tramp-default-method-alist
+            `(("\\`\\(localhost\\|\\)\\'" "" ,rootlyness)
+              (nil "." ,rootlyness))))
+     (setq tramp-default-proxies-alist
+          `(("\\`\\(localhost\\|\\)\\'" nil nil)
+            (nil "\\`root\\'" "/ssh:%h:")))))
 
 ;;;--------------------------------------------------------------------------
 ;;; General fontification.