;; At this point, we're ready to resume undo recording for scratch.
(buffer-enable-undo "*scratch*")
-(defvar comp-subr-arities-h)
-(when (featurep 'native-compile)
- ;; Save the arity for all primitives so the compiler can always
- ;; retrieve it even in case of redefinition.
- (mapatoms (lambda (f)
- (when (subr-primitive-p (symbol-function f))
- (puthash f (func-arity f) comp-subr-arities-h))))
- ;; Fix the compilation unit filename to have it working when
- ;; installed or if the source directory got moved. This is set to be
- ;; a pair in the form of:
- ;; (rel-filename-from-install-bin . rel-filename-from-local-bin).
- (let ((bin-dest-dir (cadr (member "--bin-dest" command-line-args)))
- (eln-dest-dir (cadr (member "--eln-dest" command-line-args))))
- (when (and bin-dest-dir eln-dest-dir)
- (setq eln-dest-dir
- (concat eln-dest-dir "native-lisp/" comp-native-version-dir "/"))
- (maphash (lambda (_ cu)
+(defvar load--bin-dest-dir nil
+ "Store the original value passed by \"--bin-dest\" during dump.
+Internal use only.")
+(defvar load--eln-dest-dir nil
+ "Store the original value passed by \"--eln-dest\" during dump.
+Internal use only.")
+
+(defun load--fixup-all-elns ()
+ "Fix all compilation unit filename.
+This to have it working when installed or if Emacs source
+directory got moved. This is set to be a pair in the form of:
+\(rel-filename-from-install-bin . rel-filename-from-local-bin)."
+ (when (and load--bin-dest-dir load--eln-dest-dir)
+ (setq eln-dest-dir
+ (concat load--eln-dest-dir "native-lisp/" comp-native-version-dir "/"))
+ (maphash (lambda (_ cu)
+ (when (stringp (native-comp-unit-file cu))
(let* ((file (native-comp-unit-file cu))
(preloaded (equal (substring (file-name-directory file)
-10 -1)