From e89e6343160ae694fdf51feaac7e2531c83de5c2 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 2 Jun 2013 10:50:05 +0100 Subject: Emacs: use *init-file* to track the location of init.el through symlinks --- emacs/init.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'emacs') 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))) -- cgit 1.4.1