Pages

Showing posts with label root. Show all posts
Showing posts with label root. Show all posts

Saturday, September 18, 2010

Reopen a buffer as root prompting for password if necessary

(defun find-alternative-file-with-sudo ()
"Open current buffer as root!"
(interactive)
(when buffer-file-name
(find-alternate-file
(concat "/sudo:root@localhost:"
buffer-file-name))))

(global-set-key (kbd "C-x C-r") 'find-alternative-file-with-sudo)





--
My Emacs Files At GitHub