From 457017a5a68f18de19087feb64e069775358836d Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Thu, 6 Jun 2013 23:43:50 +0300 Subject: [PATCH] Fix #337 - don't promt for sudo passwd for non-existing directories --- core/prelude-core.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/prelude-core.el b/core/prelude-core.el index cb6a43e..42139e5 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -294,6 +294,8 @@ buffer is not visiting a file." (defadvice ido-find-file (after find-file-sudo activate) "Find file as root if necessary." (unless (or (equal major-mode 'dired-mode) + (and (buffer-file-name) + (not (file-exists-p (file-name-directory (buffer-file-name))))) (and (buffer-file-name) (file-writable-p buffer-file-name))) (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))