Merge pull request #310 from lukerandall/dont-sudo-dired

Don't try edit dired buffer as root
This commit is contained in:
Bozhidar Batsov 2013-04-28 13:16:24 -07:00
commit 7181dbb5b5

View file

@ -264,8 +264,9 @@ buffer is not visiting a file."
(defadvice ido-find-file (after find-file-sudo activate)
"Find file as root if necessary."
(unless (and buffer-file-name
(file-writable-p buffer-file-name))
(unless (or (equal major-mode 'dired-mode)
(and (buffer-file-name)
(file-writable-p buffer-file-name)))
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
(defun prelude-switch-or-start (function buffer)