From 30a7f2d436b50645614b7734bacb104cf155437d Mon Sep 17 00:00:00 2001 From: Mathew <45mm.cartridge421@slmail.me> Date: Sat, 10 Feb 2024 21:57:22 +0000 Subject: [PATCH] fix(lib): doom/sudo-find-file: expand given path It's possible for the user to type shell variables (something like `$MYVAR/dir/filename`) as part of the filepath, so we need to call `expand-file-name`. --- lisp/lib/files.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/lib/files.el b/lisp/lib/files.el index 1feb20a26..2ffcc8c1e 100644 --- a/lisp/lib/files.el +++ b/lisp/lib/files.el @@ -487,7 +487,7 @@ If FORCE-P, overwrite the destination file if it exists, without confirmation." (defun doom/sudo-find-file (file) "Open FILE as root." (interactive "FOpen file as root: ") - (find-file (doom--sudo-file-path file))) + (find-file (doom--sudo-file-path (expand-file-name file)))) ;;;###autoload (defun doom/sudo-this-file ()