From: Po Lu Date: Sat, 29 Jan 2022 11:08:52 +0000 (+0800) Subject: Fix error at startup with recent change X-Git-Tag: emacs-29.0.90~2670 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a85e9d76414123a0cdd547edaf87de97436b1f46;p=emacs.git Fix error at startup with recent change * lisp/startup.el (normal-top-level): Don't access `native-comp-eln-load-path' if not (featurep 'native-compile). --- diff --git a/lisp/startup.el b/lisp/startup.el index b45cfbbdc3c..4653b1ded63 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -834,31 +834,32 @@ It is the default value of the variable `top-level'." ;; Amend `native-comp-eln-load-path' after `command-line', since ;; the latter may have altered `user-emacs-directory'. - (let ((tmp-dir (and (equal (getenv "HOME") "/nonexistent") - (file-writable-p (expand-file-name - (or temporary-file-directory ""))) - (car native-comp-eln-load-path))) - (coding (if (eq system-type 'windows-nt) - 'utf-8 - locale-coding-system))) - (if tmp-dir - (setq native-comp-eln-load-path - (cdr native-comp-eln-load-path))) - ;; 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 "eln-cache/" - (if coding - (decode-coding-string user-emacs-directory - coding t) - user-emacs-directory)) - native-comp-eln-load-path) - (when tmp-dir - ;; Recompute tmp-dir, in case user-emacs-directory affects it. - (setq tmp-dir (make-temp-file "emacs-testsuite-" t)) - (add-hook 'kill-emacs-hook (lambda () (delete-directory tmp-dir t))) - (push tmp-dir native-comp-eln-load-path))) + (when (featurep 'native-compile) + (let ((tmp-dir (and (equal (getenv "HOME") "/nonexistent") + (file-writable-p (expand-file-name + (or temporary-file-directory ""))) + (car native-comp-eln-load-path))) + (coding (if (eq system-type 'windows-nt) + 'utf-8 + locale-coding-system))) + (if tmp-dir + (setq native-comp-eln-load-path + (cdr native-comp-eln-load-path))) + ;; 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 "eln-cache/" + (if coding + (decode-coding-string user-emacs-directory + coding t) + user-emacs-directory)) + native-comp-eln-load-path) + (when tmp-dir + ;; Recompute tmp-dir, in case user-emacs-directory affects it. + (setq tmp-dir (make-temp-file "emacs-testsuite-" t)) + (add-hook 'kill-emacs-hook (lambda () (delete-directory tmp-dir t))) + (push tmp-dir native-comp-eln-load-path)))) ;; Subprocesses of Emacs do not have direct access to the terminal, so ;; unless told otherwise they should only assume a dumb terminal.