From ac667d0466f3c297b09b51ce1b7f168ffbe1c774 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Sun, 5 Jun 2011 11:47:18 +0100 Subject: [PATCH] dot/emacs: Fix the tramp hacking from last time. Organization: Straylight/Edgeware From: Mark Wooding Seems that I botched it a bit and it tried to proxy local `sudo' connections via SSH. Seems better now. --- dot/emacs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dot/emacs b/dot/emacs index 5081daf..d9b1035 100644 --- a/dot/emacs +++ b/dot/emacs @@ -603,13 +603,18 @@ (let ((rootlyness (cond ((executable-find "really") "really") ((executable-find "become") "become") ((executable-find "sudo") "sudo") - (t "su")))) + (t "su"))) + (this-host (concat "\\`\\(localhost\\|" + (system-name) "\\|\\)\\'")) + (this-user (concat "\\`\\(" (user-login-name) "\\|" + (user-real-login-name) "\\|\\)\\'"))) (setq tramp-default-method-alist - `(("\\`\\(localhost\\|\\)\\'" "" ,rootlyness) - (nil "." ,rootlyness)))) - (setq tramp-default-proxies-alist - `(("\\`\\(localhost\\|\\)\\'" nil nil) - (nil "\\`root\\'" "/ssh:%h:"))))) + `((,this-host nil ,rootlyness) + (nil ,this-user "ssh") + (nil "." ,rootlyness))) + (setq tramp-default-proxies-alist + `((,this-host nil nil) + (nil "." "/ssh:%h:")))))) ;;;-------------------------------------------------------------------------- ;;; General fontification. -- [mdw]