- Find and load the correct package.el

This commit is contained in:
Jesús 2018-07-25 15:15:49 -05:00
parent db5f35a1ad
commit d7d310a9ec
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -1,3 +1,12 @@
;;; Find and load the correct package.el
;; When switching between Emacs 23 and 24, we always use the bundled package.el in Emacs 24
(let ((package-el-site-lisp-dir
(expand-file-name "site-lisp/package" user-emacs-directory)))
(when (and (file-directory-p package-el-site-lisp-dir)
(> emacs-major-version 23))
(message "Removing local package.el from load-path to avoid shadowing bundled version")
(setq load-path (remove package-el-site-lisp-dir load-path))))
(require 'package)
;; Repositories