Skip to content

Commit

Permalink
Always install packages into an emacs-versioned elpa subdir, e.g. elp…
Browse files Browse the repository at this point in the history
…a-25.1

See purcell#418
  • Loading branch information
purcell committed Mar 24, 2017
1 parent 6c64f8e commit 4657693
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 13 additions & 0 deletions lisp/init-elpa.el
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
(require 'package)



;;; Install into separate package dirs for each Emacs version, to prevent bytecode incompatibility
(let ((versioned-package-dir
(expand-file-name (format "elpa-%s.%s" emacs-major-version emacs-minor-version)
user-emacs-directory)))
(when (file-directory-p package-user-dir)
(message "Default package locations have changed in this config: renaming old package dir %s to %s."
package-user-dir
versioned-package-dir)
(rename-file package-user-dir versioned-package-dir))
(setq package-user-dir versioned-package-dir))



;;; Standard package repositories

Expand Down
1 change: 0 additions & 1 deletion test-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ${EMACS:=emacs} -nw --batch \
--eval '(let ((debug-on-error t)
(url-show-status nil)
(user-emacs-directory default-directory)
(package-user-dir (expand-file-name (concat "elpa-" emacs-version)))
(user-init-file (expand-file-name "init.el"))
(load-path (delq default-directory load-path)))
(load-file user-init-file)
Expand Down

0 comments on commit 4657693

Please sign in to comment.