Here you can open the root file in a non-root run emacs:
erf () { SUDO_EDITOR="emacsclient -n -a emacs" sudoedit $@; } ;; erf = Emacs Root Foreground
It asks for the root password, and after entering it, it opens a copy of the file in /tmp . Example:
$ cd /etc/apt $ erf sources.list
Opens: sourcesXXiOSmYN.list . So I edit this thing and save it with Cx Cs - but it does not save:
$ sudoedit: sources.list unchanged
How can I save this? (the function will be very neat)
Edit
erf () { SUDO_EDITOR="emacsclient -a emacs" sudoedit $@; } ;; erf = Emacs Root Foreground
wraps it up. Save the file and either destroy the buffer or Cx # . He works.
linux emacs ubuntu sudo kubuntu
Adobe 01 Oct '12 at 11:21 2012-10-01 11:21
source share