summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2013-06-22 10:04:20 +0100
committerAlan Pearce2013-06-22 10:04:20 +0100
commitbd70cf69863edb293f2cf4a14275327ea411fdcf (patch)
tree7f2cd3aa6f5a5081d021f1e42adcf32dad262c06 /emacs
parent3b77cea165c47d617035c3fb622aaa9cfcc3bcaa (diff)
downloadnixfiles-bd70cf69863edb293f2cf4a14275327ea411fdcf.tar.lz
nixfiles-bd70cf69863edb293f2cf4a14275327ea411fdcf.tar.zst
nixfiles-bd70cf69863edb293f2cf4a14275327ea411fdcf.zip
Emacs: don't initialise *init-file* when user-init-file is not set
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/emacs/init.el b/emacs/init.el
index b9b29e16..6ab12fe4 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -47,7 +47,10 @@ Values: `desktop', `server', `laptop'")
   (interactive)
   (setq env/location (env/get-location)))
 
-(defvar *init-file* (expand-file-name "init.el" (file-name-directory (file-truename user-init-file)))
+(defvar *init-file*
+  (when user-init-file
+    (expand-file-name "init.el"
+                      (file-name-directory (file-truename user-init-file))))
   "Where the emacs init file really is, passing through symlinks.")
 
 ;;;; Package Management