Editing /etc/hosts in emacs

Excerpt from ~/.emacs:

(defun hosts ()
"Open /etc/hosts as root."
(interactive)
(find-file "/sudo::/etc/hosts"))

Published by

Andy Skelton

Code Wrangler @ Automattic youtube.com/AndySkelton