summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2013-06-02 10:50:05 +0100
committerAlan Pearce2013-06-02 10:50:05 +0100
commite89e6343160ae694fdf51feaac7e2531c83de5c2 (patch)
tree3cbb3701f0dffa20db04679700e95c5b8469671d
parent70a4bc8fb2620ed7cec9ab21626733dfaf952272 (diff)
downloaddotfiles-e89e6343160ae694fdf51feaac7e2531c83de5c2.tar.lz
dotfiles-e89e6343160ae694fdf51feaac7e2531c83de5c2.tar.zst
dotfiles-e89e6343160ae694fdf51feaac7e2531c83de5c2.zip
Emacs: use *init-file* to track the location of init.el through symlinks
-rw-r--r--emacs/init.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 1c224b4..f880cb3 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)))