help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sudo in emacs


From: Chris Poole
Subject: Re: sudo in emacs
Date: Tue, 10 Jan 2012 15:03:33 +0000

On Thu, Jan 5, 2012 at 4:47 PM, Rajanikanth Jammalamadaka
<rajanikanth@gmail.com> wrote:

> Is there a way I can do this using tramp?

On a file by file basis, I use this:

    (defun find-alternative-file-with-sudo ()
      "Open the current buffer with privileges given by `sudo'."
      (interactive)
      (when buffer-file-name
        (find-alternate-file
         (concat "/sudo:root@localhost:"
             buffer-file-name))))


Cheers

Chris



reply via email to

[Prev in Thread] Current Thread [Next in Thread]