From: Andrea Corallo Date: Wed, 5 May 2021 15:18:07 +0000 (+0200) Subject: Rename feature `nativecomp' into `native-compile' X-Git-Tag: emacs-28.0.90~2600 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=40736357b8b811ffbe9023527db5c2a91a9c7a5a;p=emacs.git Rename feature `nativecomp' into `native-compile' * test/src/comp-tests.el : Rename feature `nativecomp' into `native-compile'. * test/lisp/help-fns-tests.el (help-fns-test-lisp-defun): Likewise. * src/comp.c (syms_of_comp): Likewise. * lisp/startup.el (normal-top-level): Likewise. * lisp/loadup.el: Likewise. * lisp/help.el (help-function-arglist): Likewise. * lisp/emacs-lisp/package.el (package--native-compile-async) (package--delete-directory): Likewise. * lisp/emacs-lisp/nadvice.el (advice--add-function): Likewise. * lisp/emacs-lisp/comp.el (comp-ensure-native-compiler): Likewise. * lisp/emacs-lisp/advice.el (ad-add-advice): Likewise. --- diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index dc8636f8f76..8e8d0e22651 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -2076,7 +2076,7 @@ mapped to the closest extremal position). If FUNCTION was not advised already, its advice info will be initialized. Redefining a piece of advice whose name is part of the cache-id will clear the cache." - (when (and (featurep 'nativecomp) + (when (and (featurep 'native-compile) (subr-primitive-p (symbol-function function))) (comp-subr-trampoline-install function)) (cond ((not (ad-is-advised function)) diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 297c1f7ebca..f700faa38b3 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -938,7 +938,7 @@ In use by the back-end." Signal an error otherwise. To be used by all entry points." (cond - ((null (featurep 'nativecomp)) + ((null (featurep 'native-compile)) (error "Emacs was not compiled with native compiler support (--with-native-compilation)")) ((null (native-comp-available-p)) (error "Cannot find libgccjit library")))) diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index f9740565389..747572a3363 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el @@ -320,7 +320,7 @@ is also interactive. There are 3 cases: ;;;###autoload (defun advice--add-function (where ref function props) - (when (and (featurep 'nativecomp) + (when (and (featurep 'native-compile) (subr-primitive-p (gv-deref ref))) (let ((subr-name (intern (subr-name (gv-deref ref))))) ;; Requiring the native compiler to advice `macroexpand' cause a diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 503585079e4..e1339177519 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1081,7 +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 'nativecomp) + (when (and (featurep 'native-compile) (native-comp-available-p)) (let ((warning-minimum-level :error)) (native-compile-async (package-desc-dir pkg-desc) t)))) @@ -2265,7 +2265,7 @@ confirmation to install packages." "Delete DIR recursively. Clean-up the corresponding .eln files if Emacs is native compiled." - (when (featurep 'nativecomp) + (when (featurep 'native-compile) (cl-loop for file in (directory-files-recursively dir ".el\\'") do (comp-clean-up-stale-eln (comp-el-to-eln-filename file)))) diff --git a/lisp/help.el b/lisp/help.el index 6ba59ae852d..e70041aea4b 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1890,7 +1890,7 @@ the same names as used in the original source code, when possible." ((and (byte-code-function-p def) (listp (aref def 0))) (aref def 0)) ((eq (car-safe def) 'lambda) (nth 1 def)) ((eq (car-safe def) 'closure) (nth 2 def)) - ((and (featurep 'nativecomp) + ((and (featurep 'native-compile) (subrp def) (listp (subr-native-lambda-list def))) (subr-native-lambda-list def)) diff --git a/lisp/loadup.el b/lisp/loadup.el index c82d08133cf..158c02eceaa 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -449,7 +449,7 @@ lost after dumping"))) ;; At this point, we're ready to resume undo recording for scratch. (buffer-enable-undo "*scratch*") -(when (featurep 'nativecomp) +(when (featurep 'native-compile) ;; 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: @@ -521,7 +521,7 @@ lost after dumping"))) ((equal dump-mode "bootstrap") "emacs") ((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp") (t (error "unrecognized dump mode %s" dump-mode))))) - (when (and (featurep 'nativecomp) + (when (and (featurep 'native-compile) (equal dump-mode "pdump")) ;; Don't enable this before bootstrap is completed, as the ;; compiler infrastructure may not be usable yet. diff --git a/lisp/startup.el b/lisp/startup.el index 3513ab7c4ec..6bab9e364c2 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -537,7 +537,7 @@ 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 (featurep 'nativecomp) + (when (featurep 'native-compile) ;; Form `comp-eln-load-path'. (let ((path-env (getenv "EMACSNATIVELOADPATH"))) (when path-env @@ -639,7 +639,7 @@ It is the default value of the variable `top-level'." (set pathsym (mapcar (lambda (dir) (decode-coding-string dir coding t)) path))))) - (when (featurep 'nativecomp) + (when (featurep 'native-compile) (let ((npath (symbol-value 'comp-eln-load-path))) (set 'comp-eln-load-path (mapcar (lambda (dir) diff --git a/src/comp.c b/src/comp.c index a4dba435b4a..89667b2febc 100644 --- a/src/comp.c +++ b/src/comp.c @@ -5403,7 +5403,7 @@ For internal use. */); doc: /* When non-nil assume the file being compiled to be preloaded. */); - Fprovide (intern_c_string ("nativecomp"), Qnil); + Fprovide (intern_c_string ("native-compile"), Qnil); #endif /* #ifdef HAVE_NATIVE_COMP */ defsubr (&Snative_comp_available_p); diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el index 5b60939f8a8..513a0c2daea 100644 --- a/test/lisp/help-fns-tests.el +++ b/test/lisp/help-fns-tests.el @@ -62,7 +62,7 @@ Return first line of the output of (describe-function-1 FUNC)." (should (string-match regexp result)))) (ert-deftest help-fns-test-lisp-defun () - (let ((regexp (if (featurep 'nativecomp) + (let ((regexp (if (featurep 'native-compile) "a native compiled Lisp function in .+subr\\.el" "a compiled Lisp function in .+subr\\.el")) (result (help-fns-tests--describe-function 'last))) diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index ba8b8b00936..e3e4bdd9b61 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -33,7 +33,7 @@ (defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el")) -(when (featurep 'nativecomp) +(when (featurep 'native-compile) (require 'comp) (message "Compiling tests...") (load (native-compile comp-test-src))