2011-12-10

When performing system administration tasks, one often needs to edit files
owned by root.

For both security and safety reasons, it's a good idea to do as little as
possible as root (or with root privileges). For that reason, you probably
don't want to run Emacs as 'root', because it's simply too powerful. I often
see people use vi (usually, vim) instead – but since it allows you to do
just about anything as well (like running shell commands), that's not much of
an improvement.

Now, a while back we discussed editing files owned by root with tramp – you
can use emacs with your normal user-account, and use sudo to write the
root-owned file. That makes it much harder to screw things up.

Another reason people use vi for little editing jobs is because its startup
time is significantly shorter than the startup time for a new emacs
instance. For that, however, we have emacs daemon.

The editor specified by the policy is run to edit the temporary files. The sudoers policy uses the SUDO_EDITOR, VISUAL and EDITOR environment variables (in that order). If none of SUDO_EDITOR, VISUAL or EDITOR are set, the first program listed in the editor sudoers(5) option is used.

The frame is created for a moment and then closes. I see the error in xterm: E /root/new_crontabxxnil-error Symbol's value as variable is void: /sudo:root@localhost:/root/new_crontab'(set-background-color "DeepPink4")' -e '(set-foreground-color "beige")' -e '(set-cursor-color "khaki")'