summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
authorAlan Pearce2015-11-24 17:25:28 +0100
committerAlan Pearce2015-11-24 17:25:28 +0100
commit4c4ae9fbc209ce7c3b681f00b52cd24ed9407efa (patch)
tree26a490b2f882909c83d9c6b1b02bbb41c1d97be2 /tag-emacs
parentd24955325ef6d6a60e12ce1361c827e72a52e896 (diff)
downloaddotfiles-4c4ae9fbc209ce7c3b681f00b52cd24ed9407efa.tar.lz
dotfiles-4c4ae9fbc209ce7c3b681f00b52cd24ed9407efa.tar.zst
dotfiles-4c4ae9fbc209ce7c3b681f00b52cd24ed9407efa.zip
Emacs: Fix spurious sudo prompts
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.org5
1 files changed, 3 insertions, 2 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index dce9a2f..5623b99 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -1226,8 +1226,9 @@ replace helm and ido.
     :config (progn
               (defadvice counsel-find-file (after find-file-sudo activate)
                 "Find file as root if necessary."
-                (unless (and buffer-file-name
-                             (file-writable-p buffer-file-name))
+                (when (and buffer-file-name
+                           (not (file-writable-p buffer-file-name)))
+                  (message "File not writable %s" buffer-file-name)
                   (find-alternate-file (concat "/sudo::" buffer-file-name))))
               (defun counsel-switch-to-projectile-buffer (arg)
                 "Forward to `projectile-switch-to-buffer'."