summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2013-06-02 10:50:05 +0100
committerAlan Pearce2013-06-02 10:50:05 +0100
commite89e6343160ae694fdf51feaac7e2531c83de5c2 (patch)
tree3cbb3701f0dffa20db04679700e95c5b8469671d /emacs
parent70a4bc8fb2620ed7cec9ab21626733dfaf952272 (diff)
downloadnixfiles-e89e6343160ae694fdf51feaac7e2531c83de5c2.tar.lz
nixfiles-e89e6343160ae694fdf51feaac7e2531c83de5c2.tar.zst
nixfiles-e89e6343160ae694fdf51feaac7e2531c83de5c2.zip
Emacs: use *init-file* to track the location of init.el through symlinks
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 1c224b43..f880cb3b 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -41,6 +41,9 @@ 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)))
+  "Where the emacs init file really is, passing through symlinks.")
+
 ;;;; Package Management
 (eval-and-compile
   (setq package-archives '(("gnu"       . "http://elpa.gnu.org/packages/")
@@ -466,7 +469,7 @@ Values: `desktop', `server', `laptop'")
 
 (bind-key "C-c i" #'ucs-insert)
 
-(set-register ?e `(file . ,user-init-file))
+(set-register ?e `(file . ,*init-file*))
 
 ;; Enable narrowing functions C-x n
 (put 'narrow-to-defun  'disabled nil)
@@ -919,7 +922,7 @@ Also returns nil if pid is nil."
 
 (defun init-imenu (p)
   (interactive "P")
-  (find-file-existing "~/dotfiles/emacs/init.el")
+  (find-file-existing *init-file*)
   (widen)
   (helm-imenu)
   (if p (init-narrow-to-section)))