[emacs-berlin] Automatic sudo

Rasmus rasmus at gmx.us
Wed Aug 26 22:31:57 UTC 2015


Arne Brasseur <arne.brasseur at gmail.com> writes:

>   "Ask to re-open a file with sudo if it's read-only and you try to edit it.

There could be good reasons for having read-only files, say data is
archived.  Thus, shouldn't you rather explicitly check whether either the
owner is not you or the owner is root?  Potentially also the group
membership.  [No idea how these concepts work in Emacs on windows].

       (nth 2 (file-attributes "/etc/profile" 'string)) => root

>  (find-file (concat "/sudo:root at localhost:" path))

You could use (concat "/sudo::" path), but maybe it will act differently
on remotes.


You people at the NSA are becoming my new best friends!

More information about the emacs-berlin mailing list