For some reason (see below) I wanted to install package-user-dir (ELPA) in the lisp directory.
It should be possible to derive the lisp directory from the standard exec-directory variable:
(setq site-lisp-directory (concat exec-directory "../site-lisp")
At least with pre-compiled versions of GNU Emacs, this works (the directory already exists). Over time, create a directory:
(unless (file-accessible-directory-p site-lisp-directory) (make-directory site-lisp-directory))
My motivation was that package-user-dir by default %USERPROFILE%/.emacs.d/elpa/ , which seems like a rather strange place. Packages must be installed on the system for all users. Also ~/.emacs.d contains server settings, autosave-lists and backups. What to do where Emacs has a dedicated lisp directory that you can specify.
However, the real "problem" was the pre-compiled Emacs 24.3 for Windows. It does not require installation and, therefore, can be carried out portable, for example, from a stick. Then IMHO ELPA must use its lisp directory, so packages are also installed with delivery.
Andreas Spindler
source share