Function: startup-redirect-eln-cache
startup-redirect-eln-cache is a byte-compiled function defined in
startup.el.gz.
Signature
(startup-redirect-eln-cache CACHE-DIRECTORY)
Documentation
Redirect the user's eln-cache directory to CACHE-DIRECTORY.
CACHE-DIRECTORY must be a single directory, a string.
This function destructively changes native-comp-eln-load-path
so that its first element is CACHE-DIRECTORY. If CACHE-DIRECTORY
is not an absolute file name, it is interpreted relative
to user-emacs-directory.
For best results, call this function in your early-init file,
so that the rest of initialization and package loading uses
the updated value.
Probably introduced at or before Emacs version 29.1.
Source Code
;; Defined in /usr/src/emacs/lisp/startup.el.gz
(defun startup-redirect-eln-cache (cache-directory)
"Redirect the user's eln-cache directory to CACHE-DIRECTORY.
CACHE-DIRECTORY must be a single directory, a string.
This function destructively changes `native-comp-eln-load-path'
so that its first element is CACHE-DIRECTORY. If CACHE-DIRECTORY
is not an absolute file name, it is interpreted relative
to `user-emacs-directory'.
For best results, call this function in your early-init file,
so that the rest of initialization and package loading uses
the updated value."
;; Remove the original eln-cache.
(setq native-comp-eln-load-path (cdr native-comp-eln-load-path))
;; Add the new eln-cache.
(push (expand-file-name (file-name-as-directory cache-directory)
user-emacs-directory)
native-comp-eln-load-path))