* Fix `comp-dry-run' effectiveness

* lisp/emacs-lisp/comp.el (comp-compile-ctxt-to-file): Remove
	`comp-dry-run' guard.
	(comp-final): And move it here so is effective for interactive
	sessions and non.
This commit is contained in:
Andrea Corallo 2020-10-25 09:41:56 +00:00
parent 99e7cc0da6
commit ada80d66d6

View file

@ -2526,8 +2526,7 @@ Prepare every function for final compilation and drive the C back-end."
;; In case it's created in the meanwhile.
(ignore-error 'file-already-exists
(make-directory dir t)))
(unless comp-dry-run
(comp--compile-ctxt-to-file name))))
(comp--compile-ctxt-to-file name)))
(defun comp-final1 ()
(let (compile-result)
@ -2540,6 +2539,7 @@ Prepare every function for final compilation and drive the C back-end."
(defun comp-final (_)
"Final pass driving the C back-end for code emission."
(unless comp-dry-run
(if noninteractive
(comp-final1)
;; Call comp-final1 in a child process.
@ -2577,7 +2577,7 @@ Prepare every function for final compilation and drive the C back-end."
nil t t "--batch" "-l" temp-file))
output
(signal 'native-compiler-error (buffer-string)))
(comp-log-to-buffer (buffer-string)))))))
(comp-log-to-buffer (buffer-string))))))))
;;; Compiler type hints.