emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/pq 377f408a56: Improve package build in batch mode


From: ELPA Syncer
Subject: [elpa] externals/pq 377f408a56: Improve package build in batch mode
Date: Wed, 20 Jul 2022 02:57:52 -0400 (EDT)

branch: externals/pq
commit 377f408a567a73781490885756b111f4658e1c2d
Author: Mario Rodas <marsam@users.noreply.github.com>
Commit: Mario Rodas <marsam@users.noreply.github.com>

    Improve package build in batch mode
    
    Co-authored-by: monnier <monnier@users.noreply.github.com>
---
 .elpaignore   |  1 +
 pq-compile.el | 31 +++++++++++++++++++------------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/.elpaignore b/.elpaignore
new file mode 100644
index 0000000000..955449dbf6
--- /dev/null
+++ b/.elpaignore
@@ -0,0 +1 @@
+pq-test.el
diff --git a/pq-compile.el b/pq-compile.el
index 5899ce7620..b16a06f659 100644
--- a/pq-compile.el
+++ b/pq-compile.el
@@ -37,21 +37,28 @@
       (if (zerop exitcode)
           (message "Compilation of `pq-core' succeeded")
         (let ((out (buffer-string)))
-          (with-current-buffer (get-buffer-create "*pq-compile*")
-            (setq default-directory pq--compile-directory)
-            (let ((inhibit-read-only t))
-              (erase-buffer)
-              (insert out))
-            (compilation-mode)
-            (pop-to-buffer (current-buffer))
-            (error "Compilation of `pq-core' failed")))))))
+          (if noninteractive
+              (message "Compilation of `pq-core' failed:\n%s" out)
+            (with-current-buffer (get-buffer-create "*pq-compile*")
+              (setq default-directory pq--compile-directory)
+              (let ((inhibit-read-only t))
+                (erase-buffer)
+                (insert out))
+              (compilation-mode)
+              (pop-to-buffer (current-buffer))
+              (error "Compilation of `pq-core' failed"))))))))
 
 (defun pq--compile-maybe ()
-  ;; FIXME: Should we first try it silently (i.e. without prompting the user)?
-  (if (not (y-or-n-p "PQ needs to compile the `pq-core' module.  Do it now?"))
-      (message "Continuing without `pq-core'; some operations may fail")
+  (cond
+   (noninteractive ;; Batch use: try to compile but delay errors when possible.
+    (ignore-errors (pq--compile-module))
+    (require 'pq-core nil t))
+   ;; FIXME: Should we first try it silently (i.e. without prompting the user)?
+   ((not (y-or-n-p "PQ needs to compile the `pq-core' module.  Do it now?"))
+    (message "Continuing without `pq-core'; some operations may fail"))
+   (t
     (pq--compile-module)
-    (require 'pq-core)))
+    (require 'pq-core))))
 
 
 (provide 'pq-compile)



reply via email to

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