Browse Source

Merge branch 'master' of github.com:bbatsov/prelude

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
custom
Bozhidar Batsov 13 years ago
parent
commit
4c1b6b9dea
  1. 5
      core/prelude-core.el

5
core/prelude-core.el

@ -264,8 +264,9 @@ buffer is not visiting a file."
(defadvice ido-find-file (after find-file-sudo activate) (defadvice ido-find-file (after find-file-sudo activate)
"Find file as root if necessary." "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)))) (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
(defun prelude-start-or-switch-to (function buffer-name) (defun prelude-start-or-switch-to (function buffer-name)

Loading…
Cancel
Save