emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp ada80d6 1/2: * Fix `comp-dry-run' effectiveness


From: Andrea Corallo
Subject: feature/native-comp ada80d6 1/2: * Fix `comp-dry-run' effectiveness
Date: Sun, 25 Oct 2020 11:20:51 -0400 (EDT)

branch: feature/native-comp
commit ada80d66d663ac9e07082f6038528f004f9aca1f
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * 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.
---
 lisp/emacs-lisp/comp.el | 80 ++++++++++++++++++++++++-------------------------
 1 file changed, 40 insertions(+), 40 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 4967e85..a13b974 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -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,44 +2539,45 @@ 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."
-  (if noninteractive
-      (comp-final1)
-    ;; Call comp-final1 in a child process.
-    (let* ((output (comp-ctxt-output comp-ctxt))
-           (print-escape-newlines t)
-           (print-length nil)
-           (print-level nil)
-           (print-quoted t)
-           (print-gensym t)
-           (print-circle t)
-           (expr `(progn
-                    (require 'comp)
-                    (setf comp-speed ,comp-speed
-                          comp-debug ,comp-debug
-                          comp-verbose ,comp-verbose
-                          comp-ctxt ,comp-ctxt
-                          comp-eln-load-path ',comp-eln-load-path
-                          comp-native-driver-options
-                          ',comp-native-driver-options
-                          load-path ',load-path)
-                    ,comp-async-env-modifier-form
-                    (message "Compiling %s..." ',output)
-                    (comp-final1)))
-           (temp-file (make-temp-file
-                       (concat "emacs-int-comp-"
-                               (file-name-base output) "-")
-                       nil ".el")))
-      (with-temp-file temp-file
-        (insert (prin1-to-string expr)))
-      (with-temp-buffer
-        (unwind-protect
-            (if (zerop
-                 (call-process (expand-file-name invocation-name
-                                                 invocation-directory)
-                               nil t t "--batch" "-l" temp-file))
-                output
-              (signal 'native-compiler-error (buffer-string)))
-          (comp-log-to-buffer (buffer-string)))))))
+  (unless comp-dry-run
+    (if noninteractive
+       (comp-final1)
+      ;; Call comp-final1 in a child process.
+      (let* ((output (comp-ctxt-output comp-ctxt))
+             (print-escape-newlines t)
+             (print-length nil)
+             (print-level nil)
+             (print-quoted t)
+             (print-gensym t)
+             (print-circle t)
+             (expr `(progn
+                      (require 'comp)
+                      (setf comp-speed ,comp-speed
+                            comp-debug ,comp-debug
+                            comp-verbose ,comp-verbose
+                            comp-ctxt ,comp-ctxt
+                            comp-eln-load-path ',comp-eln-load-path
+                            comp-native-driver-options
+                            ',comp-native-driver-options
+                            load-path ',load-path)
+                      ,comp-async-env-modifier-form
+                      (message "Compiling %s..." ',output)
+                      (comp-final1)))
+             (temp-file (make-temp-file
+                        (concat "emacs-int-comp-"
+                                (file-name-base output) "-")
+                        nil ".el")))
+       (with-temp-file temp-file
+          (insert (prin1-to-string expr)))
+       (with-temp-buffer
+          (unwind-protect
+              (if (zerop
+                   (call-process (expand-file-name invocation-name
+                                                   invocation-directory)
+                                nil t t "--batch" "-l" temp-file))
+                  output
+               (signal 'native-compiler-error (buffer-string)))
+            (comp-log-to-buffer (buffer-string))))))))
 
 
 ;;; Compiler type hints.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]