diff options
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 3 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el | 1 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/bytecomp-tests.el | 7 |
3 files changed, 11 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 04c107a7cfa..4fd65bb5d53 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -2089,6 +2089,9 @@ If compilation is needed, this functions returns the result of | |||
| 2089 | The output file's name is generated by passing FILENAME to the | 2089 | The output file's name is generated by passing FILENAME to the |
| 2090 | function `byte-compile-dest-file' (which see). | 2090 | function `byte-compile-dest-file' (which see). |
| 2091 | The value is non-nil if there were no errors, nil if errors. | 2091 | The value is non-nil if there were no errors, nil if errors. |
| 2092 | If the file sets the file variable `no-byte-compile', it is not | ||
| 2093 | compiled, any existing output file is removed, and the return | ||
| 2094 | value is `no-byte-compile'. | ||
| 2092 | 2095 | ||
| 2093 | See also `emacs-lisp-byte-compile-and-load'." | 2096 | See also `emacs-lisp-byte-compile-and-load'." |
| 2094 | (declare (advertised-calling-convention (filename) "28.1")) | 2097 | (declare (advertised-calling-convention (filename) "28.1")) |
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el b/test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el new file mode 100644 index 00000000000..00ad1947507 --- /dev/null +++ b/test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el | |||
| @@ -0,0 +1 @@ | |||
| ;; -*- no-byte-compile: t; -*- | |||
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el index fbc00b30c54..9c5bef09a34 100644 --- a/test/lisp/emacs-lisp/bytecomp-tests.el +++ b/test/lisp/emacs-lisp/bytecomp-tests.el | |||
| @@ -1642,6 +1642,13 @@ EXPECTED-POINT BINDINGS (MODES \\='\\='(ruby-mode js-mode python-mode)) \ | |||
| 1642 | (setq actual (nreverse actual)) | 1642 | (setq actual (nreverse actual)) |
| 1643 | (should (equal actual expected))))))) | 1643 | (should (equal actual expected))))))) |
| 1644 | 1644 | ||
| 1645 | (ert-deftest byte-compile-file/no-byte-compile () | ||
| 1646 | (let* ((src-file (ert-resource-file "no-byte-compile.el")) | ||
| 1647 | (dest-file (make-temp-file "bytecomp-tests-" nil ".elc")) | ||
| 1648 | (byte-compile-dest-file-function (lambda (_) dest-file))) | ||
| 1649 | (should (eq (byte-compile-file src-file) 'no-byte-compile)) | ||
| 1650 | (should-not (file-exists-p dest-file)))) | ||
| 1651 | |||
| 1645 | 1652 | ||
| 1646 | ;; Local Variables: | 1653 | ;; Local Variables: |
| 1647 | ;; no-byte-compile: t | 1654 | ;; no-byte-compile: t |