[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-28 d86b2e5: native-comp-available-p is the definitive test
From: |
Stephen Gildea |
Subject: |
emacs-28 d86b2e5: native-comp-available-p is the definitive test |
Date: |
Tue, 5 Oct 2021 12:24:23 -0400 (EDT) |
branch: emacs-28
commit d86b2e59c746966e1ae023937b2a6b3b8c16d18b
Author: Stephen Gildea <stepheng+emacs@gildea.com>
Commit: Stephen Gildea <stepheng+emacs@gildea.com>
native-comp-available-p is the definitive test
* doc/lispref/compile.texi (Native Compilation): Document
native-comp-available-p as the way to test for native compilation.
* lisp/emacs-lisp/package.el (package--native-compile-async):
* test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines):
Test for native compilation with native-comp-available-p.
Thank you to Andrea Corallo for reviewing this patch.
---
doc/lispref/compile.texi | 3 +--
lisp/emacs-lisp/package.el | 3 +--
test/lisp/mh-e/mh-utils-tests.el | 2 +-
3 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 15d1f4c..523758c 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -811,8 +811,7 @@ for you to be able to native-compile Lisp code.
@vindex native-compile@r{, a Lisp feature}
To determine whether the current Emacs process can produce and load
-natively-compiled Lisp code, test whether the @code{native-compile}
-feature is available (@pxref{Named Features}). Alternatively, call
+natively-compiled Lisp code, call
@code{native-comp-available-p} (@pxref{Native-Compilation Functions}).
Unlike byte-compiled code, natively-compiled Lisp code is executed
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 62f5fc7..5445fa9 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1081,8 +1081,7 @@ This assumes that `pkg-desc' has already been activated
with
"Native compile installed package PKG-DESC asynchronously.
This assumes that `pkg-desc' has already been activated with
`package-activate-1'."
- (when (and (featurep 'native-compile)
- (native-comp-available-p))
+ (when (native-comp-available-p)
(let ((warning-minimum-level :error))
(native-compile-async (package-desc-dir pkg-desc) t))))
diff --git a/test/lisp/mh-e/mh-utils-tests.el b/test/lisp/mh-e/mh-utils-tests.el
index 82afbab..f1282ab 100644
--- a/test/lisp/mh-e/mh-utils-tests.el
+++ b/test/lisp/mh-e/mh-utils-tests.el
@@ -113,7 +113,7 @@ As `call-process'' and `file-directory-p' will be
redefined, the
native compiler will invoke `call-process' to compile the
respective trampolines. To avoid interferences with the
`call-process' mocking we build these AOT."
- (when (featurep 'native-compile)
+ (when (native-comp-available-p)
(mapc #'comp-subr-trampoline-install '(call-process file-directory-p))))
(defun mh-test-utils-setup-with-mocks ()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-28 d86b2e5: native-comp-available-p is the definitive test,
Stephen Gildea <=