From: Mark Wooding Date: Sun, 5 Jun 2011 01:43:48 +0000 (+0100) Subject: dot/emacs: Tramp hacking: use `sudo', and set up magic proxies. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/415c9a27219460e41fa8148893799525dbe15339 dot/emacs: Tramp hacking: use `sudo', and set up magic proxies. --- diff --git a/dot/emacs b/dot/emacs index 8832f3f..5081daf 100644 --- a/dot/emacs +++ b/dot/emacs @@ -600,12 +600,16 @@ (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.