forked from vlaci/nix-doom-emacs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrestart-emacs.patch
22 lines (20 loc) · 1.21 KB
/
restart-emacs.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/restart-emacs.el 1970-01-01 02:00:01.000000000 +0200
+++ b/restart-emacs.el 2021-06-13 14:37:50.520954543 +0300
@@ -94,12 +94,13 @@
"Get absolute path to binary of currently running Emacs.
On Windows get path to runemacs.exe if possible."
- (let ((emacs-binary-path (expand-file-name invocation-name invocation-directory))
- (runemacs-binary-path (when (memq system-type '(windows-nt ms-dos))
- (expand-file-name "runemacs.exe" invocation-directory))))
- (if (and runemacs-binary-path (file-exists-p runemacs-binary-path))
- runemacs-binary-path
- emacs-binary-path)))
+ (if (getenv "NIX_DOOM_EMACS_BINARY") (getenv "NIX_DOOM_EMACS_BINARY")
+ (let ((emacs-binary-path (expand-file-name invocation-name invocation-directory))
+ (runemacs-binary-path (when (memq system-type '(windows-nt ms-dos))
+ (expand-file-name "runemacs.exe" invocation-directory))))
+ (if (and runemacs-binary-path (file-exists-p runemacs-binary-path))
+ runemacs-binary-path
+ emacs-binary-path))))
(defun restart-emacs--record-tty-file (current &rest ignored)
"Save the buffer which is being currently selected in the frame.