- (setq tramp-default-method-alist
- `(("\\`localhost\\'" ""
- ,(cond ((executable-find "become") "become")
- ((executable-find "really") "really")
- (t "su")))))))
+ (let ((rootlyness (cond ((executable-find "really") "really")
+ ((executable-find "become") "become")
+ ((executable-find "sudo") "sudo")
+ (t "su")))
+ (this-host (concat "\\`\\(localhost\\|"
+ (system-name) "\\|\\)\\'"))
+ (this-user (concat "\\`\\(" (user-login-name) "\\|"
+ (user-real-login-name) "\\|\\)\\'")))
+ (setq tramp-default-method-alist
+ `((,this-host nil ,rootlyness)
+ (nil ,this-user "ssh")
+ (nil "." ,rootlyness)))
+ (setq tramp-default-proxies-alist
+ `((,this-host nil nil)
+ (nil "." "/ssh:%h:"))))))