fix: doom/reload runs remotely in tramp buffers

When run in a remote buffer, `doom sync` is executed on the remote host,
which is not intended behavior.

Fix #5378
This commit is contained in:
Henrik Lissner 2021-08-14 02:28:14 -04:00
parent 9b177957f8
commit 462bfb9693

View file

@ -51,7 +51,8 @@ And jumps to your `doom!' block."
(defmacro doom--if-compile (command on-success &optional on-failure)
(declare (indent 2))
`(with-current-buffer (compile ,command t)
`(let ((default-directory doom-emacs-dir))
(with-current-buffer (compile ,command t)
(let ((w (get-buffer-window (current-buffer))))
(select-window w)
(add-hook
@ -62,7 +63,7 @@ And jumps to your `doom!' block."
(delete-window w)
,on-success)
,on-failure))
nil 'local))))
nil 'local)))))
;;;###autoload
(defun doom/reload ()
@ -115,8 +116,10 @@ Doing so from within Emacs will taint your shell environment.
An envvar file contains a snapshot of your shell environment, which can be
imported into Emacs."
(interactive)
(let ((default-directory doom-emacs-dir))
(with-temp-buffer
(doom-load-envvars-file doom-env-file)
(message "Reloaded %S" (abbreviate-file-name doom-env-file)))
(message "Reloaded %S" (abbreviate-file-name doom-env-file)))))
;;;###autoload
(defun doom/upgrade ()