find-file-sudo is very broken
This commit is contained in:
parent
a0fc35c2c7
commit
1b87d2ac9d
@ -50,13 +50,13 @@
|
|||||||
:custom (tramp-persistency-file-name
|
:custom (tramp-persistency-file-name
|
||||||
(expand-file-name "tramp-history" backup-directory))
|
(expand-file-name "tramp-history" backup-directory))
|
||||||
:config
|
:config
|
||||||
(defun find-file-sudo (&rest throwaway)
|
(defun find-current-file-sudo (&rest throwaway)
|
||||||
(interactive)
|
;; (interactive)
|
||||||
(if buffer-file-name
|
(if buffer-file-name
|
||||||
(unless (or (file-writable-p buffer-file-name)
|
(unless (or (file-writable-p buffer-file-name)
|
||||||
(file-directory-p buffer-file-name))
|
(file-directory-p buffer-file-name))
|
||||||
(find-alternate-file (format "/sudo::%s" buffer-file-name)))))
|
(find-alternate-file (format "/sudo::%s" buffer-file-name)))))
|
||||||
(advice-add #'find-file :after #'find-file-sudo))
|
(advice-add #'find-file :after #'find-current-file-sudo))
|
||||||
|
|
||||||
;; Visualize whitespace. In a very chill and invisible way.
|
;; Visualize whitespace. In a very chill and invisible way.
|
||||||
(use-package image-mode
|
(use-package image-mode
|
||||||
|
Loading…
Reference in New Issue
Block a user