Ever so often I open a file that I don’t I have permission to edit (so automatically Emacs will go into read-only-mode). It’s only then I find that I need to edit it, so I will have to type in the following command to open this file, again, as root:

To reduce the number of keystrokes this small Elips function can be useful. It detects if there’s a file that is associated with the current buffer, if so open this file as root permissions:

Above function is only effective for local file.