]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix spurious "Compilation finished" native-comp messages
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 17 Oct 2022 12:30:54 +0000 (14:30 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 17 Oct 2022 12:30:54 +0000 (14:30 +0200)
* lisp/emacs-lisp/comp.el (native--compile-async): Don't start the
async compilation if we didn't add anything.  This avoids spurious
"Compilation finished" messages in the *Async* buffer when it
turned out that all the files we considered nativecomping were
skipped.

lisp/emacs-lisp/comp.el

index c300c44a8d72db280a2f92e19b621b4dd0fa5db2..686c7aeb3db31ffc924f4b25815e6574ef04a65c 100644 (file)
@@ -4167,7 +4167,8 @@ bytecode definition was not changed in the meantime)."
     (error "LOAD must be nil, t or 'late"))
   (unless (listp files)
     (setf files (list files)))
-  (let (file-list)
+  (let ((added-something nil)
+        file-list)
     (dolist (file-or-dir files)
       (cond ((file-directory-p file-or-dir)
              (dolist (file (if recursively
@@ -4195,11 +4196,15 @@ bytecode definition was not changed in the meantime)."
               (make-directory out-dir t))
             (if (file-writable-p out-filename)
                 (setf comp-files-queue
-                      (append comp-files-queue `((,file . ,load))))
+                      (append comp-files-queue `((,file . ,load)))
+                      added-something t)
               (display-warning 'comp
                                (format "No write access for %s skipping."
                                        out-filename)))))))
-    (when (zerop (comp-async-runnings))
+    ;; Perhaps nothing passed `native-compile-async-skip-p'?
+    (when (and added-something
+               ;; Don't start if there's one already running.
+               (zerop (comp-async-runnings)))
       (comp-run-async-workers))))
 
 \f