aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-10-26 19:12:36 -0500
committerJesús <heckyel@hyperbola.info>2019-10-26 19:12:36 -0500
commitc5ff8b40568de54adb081a93d2ac9b3454060ad9 (patch)
tree35d0fa4a62bd8da50ac5ca0608eebdbcf0a1e458
parentf3d6ca2ac190799afb6201e8f358b44dbd390dec (diff)
downloademacs-personal-c5ff8b40568de54adb081a93d2ac9b3454060ad9.tar.lz
emacs-personal-c5ff8b40568de54adb081a93d2ac9b3454060ad9.tar.xz
emacs-personal-c5ff8b40568de54adb081a93d2ac9b3454060ad9.zip
Added 'sudo open file option'
-rw-r--r--modules/init-gui.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/init-gui.el b/modules/init-gui.el
index e4808b0..0e4a40a 100644
--- a/modules/init-gui.el
+++ b/modules/init-gui.el
@@ -85,6 +85,15 @@
browse-url-generic-program "iceweasel-uxp")
;;----------------------------------------------------------------------------
+;; sudo open file option
+;;----------------------------------------------------------------------------
+(defun sudo-find-file (file-name)
+ "Like find file, but opens the file as root."
+ (interactive "FSudo Find File: ")
+ (let ((tramp-file-name (concat "/sudo::" (expand-file-name file-name))))
+ (find-file tramp-file-name)))
+
+;;----------------------------------------------------------------------------
;; clock
;;----------------------------------------------------------------------------
(setq display-time-day-and-date t)