- (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"))))
+ (setq tramp-default-method-alist
+ `(("\\`\\(localhost\\|\\)\\'" "" ,rootlyness)
+ (nil "." ,rootlyness))))
+ (setq tramp-default-proxies-alist
+ `(("\\`\\(localhost\\|\\)\\'" nil nil)
+ (nil "\\`root\\'" "/ssh:%h:")))))