From 3ed11cacfefe5ee2050959d78783aadb3252f470 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 7 Jun 2018 00:57:28 -0700 Subject: [PATCH] Use actual compilation directory instead of PWD --- emacs/.emacs.d/init.el | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 12c98a8..69f3773 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -26,17 +26,20 @@ ;;; Code: (eval-and-compile - (add-to-list 'load-path (format "%sinit/" default-directory)) + (let ((load-directory + (file-name-directory + (or load-file-name byte-compile-current-file)))) + (add-to-list 'load-path (format "%sinit/" load-directory)) - (mapc (lambda (d) (add-to-list 'load-path d)) - (directory-files - (format "%svendor-lisp/" default-directory) t "^[^.]")) + (mapc (lambda (d) (add-to-list 'load-path d)) + (directory-files + (format "%svendor-lisp/" load-directory) t "^[^.]")) - (add-to-list 'load-path (format "%ssite-lisp/" default-directory)) + (add-to-list 'load-path (format "%ssite-lisp/" load-directory)) - (let ((loaddefs (format "%ssite-lisp/site-autoloads.el" default-directory))) - (when (file-exists-p loaddefs) - (load loaddefs)))) + (let ((loaddefs (format "%ssite-lisp/site-autoloads.el" load-directory))) + (when (file-exists-p loaddefs) + (load loaddefs))))) (require 'oni-helpers)