On Thu, 21 Nov 2002, [EMAIL PROTECTED] wrote:
>         I've been using tramp for a while, it's really helpful. I
>         use it mostly with "sudo", to edit system files in my always
>         open xemacs (instead of "sudo vi").
> 
>         However, having to type "/[root@localhost]" is getting old
>         faster
> and faster :)
> 
>         In fact, in the sudo and su methods I'm not even allowed a
>         host
> other than "localhost", and I still have to type it!
> 
>         What do you think?

I use the following, mostly stolen from someone else...

(defvar find-file-root-method "multi/sudo:"
  "*The Tramp method to use for opening files with `find-file-root'.")
(defvar find-file-root-user   "root"
  "*The user to su to when opening files with `find-file-root'.")
(defvar find-file-root-host   "localhost"
  "*The host to use when opening files with `find-file-root'.")

(defun find-file-root (file)
  "Open FILE sued to a different user..
Uses the method specified in `find-file-root-method' and the user from
`find-file-root-user'."
  (interactive "FFind file (as UID 0): ")
  (require 'tramp)
  (find-file (concat "/[" find-file-root-method find-file-root-user "@" 
find-file-root-host "]" file)))

(global-set-key [(control x) (control r)] 'find-file-root)

Ted


_______________________________________________
Tramp-devel mailing list
[EMAIL PROTECTED]
http://mail.nongnu.org/mailman/listinfo/tramp-devel

Reply via email to