From: Mark Wooding Date: Sun, 5 Jun 2011 10:47:18 +0000 (+0100) Subject: dot/emacs: Fix the tramp hacking from last time. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/ac667d0466f3c297b09b51ce1b7f168ffbe1c774?ds=sidebyside dot/emacs: Fix the tramp hacking from last time. Seems that I botched it a bit and it tried to proxy local `sudo' connections via SSH. Seems better now. --- 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.