-(add-to-list 'load-path "~/.emacs.d/auto-install")
-(setq custom-file "~/.emacs.d/emacs-custom.el")
+(let ((base (file-name-directory
+ (directory-file-name
+ (file-name-directory
+ (or load-file-name
+ (when (boundp 'bytecomp-filename) bytecomp-filename) buffer-file-name))))))
+
+ (add-to-list 'load-path (concat base "lib"))
+ (setq custom-file (concat base "emacs-custom.el")))
+
(load custom-file)