* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Document behavior
if 'no-byte-compile' is set.
* test/lisp/emacs-lisp/bytecomp-tests.el
(byte-compile-file/no-byte-compile): New unit test.
* test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el: New test
file.
The output file's name is generated by passing FILENAME to the
function `byte-compile-dest-file' (which see).
The value is non-nil if there were no errors, nil if errors.
+If the file sets the file variable `no-byte-compile', it is not
+compiled, any existing output file is removed, and the return
+value is `no-byte-compile'.
See also `emacs-lisp-byte-compile-and-load'."
(declare (advertised-calling-convention (filename) "28.1"))
--- /dev/null
+;; -*- no-byte-compile: t; -*-
(setq actual (nreverse actual))
(should (equal actual expected)))))))
+(ert-deftest byte-compile-file/no-byte-compile ()
+ (let* ((src-file (ert-resource-file "no-byte-compile.el"))
+ (dest-file (make-temp-file "bytecomp-tests-" nil ".elc"))
+ (byte-compile-dest-file-function (lambda (_) dest-file)))
+ (should (eq (byte-compile-file src-file) 'no-byte-compile))
+ (should-not (file-exists-p dest-file))))
+
;; Local Variables:
;; no-byte-compile: t