From: Andrea Corallo Date: Thu, 19 Nov 2020 23:59:00 +0000 (+0100) Subject: Add 'EMACSNATIVELOADPATH' env variable support (bug#44726) X-Git-Tag: emacs-28.0.90~2727^2~308 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a55415af7ea8ddc09dfda32ccb866c6556bb71c1;p=emacs.git Add 'EMACSNATIVELOADPATH' env variable support (bug#44726) * lisp/startup.el (normal-top-level): Read 'EMACSNATIVELOADPATH' and add entries too `comp-eln-load-path'. * lisp/mail/emacsbug.el (report-emacs-bug): Dump also 'EMACSNATIVELOADPATH'. --- diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index d524b26f1b9..4af8780d980 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -313,7 +313,7 @@ usually do not have translators for other languages.\n\n"))) (lambda (var) (let ((val (getenv var))) (if val (insert (format " value of $%s: %s\n" var val))))) - '("EMACSDATA" "EMACSDOC" "EMACSLOADPATH" "EMACSPATH" + '("EMACSDATA" "EMACSDOC" "EMACSLOADPATH" "EMACSNATIVELOADPATH" "EMACSPATH" "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_MONETARY" "LC_NUMERIC" "LC_TIME" "LANG" "XMODIFIERS")) (insert (format " locale-coding-system: %s\n" locale-coding-system)) diff --git a/lisp/startup.el b/lisp/startup.el index 89b1d59ce0a..2beeaa195d0 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -534,9 +534,13 @@ It is the default value of the variable `top-level'." (setq user-emacs-directory (startup--xdg-or-homedot startup--xdg-config-home-emacs nil)) - (when (boundp 'comp-eln-load-path) - (setq comp-eln-load-path (cons (concat user-emacs-directory "eln-cache/") - comp-eln-load-path))) + (when (featurep 'nativecomp) + (let ((path-env (getenv "EMACSNATIVELOADPATH"))) + (when path-env + (dolist (path (split-string path-env ":")) + (unless (string= "" path) + (push path comp-eln-load-path))))) + (push (concat user-emacs-directory "eln-cache/") comp-eln-load-path)) ;; Look in each dir in load-path for a subdirs.el file. If we ;; find one, load it, which will add the appropriate subdirs of ;; that dir into load-path. This needs to be done before setting