emacs-diffs
[Top][All Lists]
Advanced

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

scratch/package-vc-fixes 9d4f179f95 3/3: Make documentation building for


From: Philip Kaludercic
Subject: scratch/package-vc-fixes 9d4f179f95 3/3: Make documentation building for source packages more robust
Date: Thu, 10 Nov 2022 18:09:57 -0500 (EST)

branch: scratch/package-vc-fixes
commit 9d4f179f951eb1f3bfba5fc2325daf5128444503
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Make documentation building for source packages more robust
    
    * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation): Log
    output and display error messages if anything goes wrong.
---
 lisp/emacs-lisp/package-vc.el | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 55daa48e3e..a50f7fbda9 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -353,10 +353,8 @@ asynchronously."
 FILE can be an Org file, indicated by its \".org\" extension,
 otherwise it's assumed to be an Info file."
   (let* ((pkg-name (package-desc-name pkg-desc))
-         (pkg-dir (package-desc-dir pkg-desc))
-         (output (file-name-concat
-                  (format "%s.info" pkg-name)
-                  pkg-dir)))
+         (default-directory (package-desc-dir pkg-desc))
+         (output (expand-file-name (format "%s.info" pkg-name))))
     (when (string-match-p "\\.org\\'" file)
       (require 'ox)
       (require 'ox-texinfo)
@@ -364,10 +362,18 @@ otherwise it's assumed to be an Info file."
         (insert-file-contents file)
         (setq file (make-temp-file "ox-texinfo-"))
         (org-export-to-file 'texinfo file)))
-    (call-process "makeinfo" nil nil nil
-                  "--no-split" file "-o" output)
-    (call-process "install-info" nil nil nil
-                  output pkg-dir)))
+    (with-current-buffer (get-buffer-create " *package-vc doc*")
+      (erase-buffer)
+      (cond
+       ((/= 0 (call-process "makeinfo" nil t nil
+                            "--no-split" file "-o" output))
+        (message "Failed to build manual %s, see buffer %S"
+                 file (buffer-name)))
+       ((/= 0 (call-process "install-info" nil t nil
+                            output (expand-file-name "dir")))
+        (message "Failed to install manual %s, see buffer %S"
+                 output (buffer-name)))
+       ((kill-buffer))))))
 
 (defun package-vc--unpack-1 (pkg-desc pkg-dir)
   "Prepare PKG-DESC that is already checked-out in PKG-DIR.



reply via email to

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