From 32f51f17c425baf6e816a51f0823d58ef79f3d3d Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 15 Nov 2022 13:27:59 +0100 Subject: [PATCH] Remove temporary .texi files if used to build documentation * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation): Remember if a temporary file was generated and delete it afterwards. --- lisp/emacs-lisp/package-vc.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 78d09400c9f..bf8deb20244 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -355,14 +355,16 @@ 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)) (default-directory (package-desc-dir pkg-desc)) - (output (expand-file-name (format "%s.info" pkg-name)))) + (output (expand-file-name (format "%s.info" pkg-name))) + clean-up) (when (string-match-p "\\.org\\'" file) (require 'ox) (require 'ox-texinfo) (with-temp-buffer (insert-file-contents file) (setq file (make-temp-file "ox-texinfo-")) - (org-export-to-file 'texinfo file))) + (org-export-to-file 'texinfo file) + (setq clean-up t))) (with-current-buffer (get-buffer-create " *package-vc doc*") (erase-buffer) (cond @@ -374,7 +376,9 @@ otherwise it's assumed to be an Info file." output (expand-file-name "dir"))) (message "Failed to install manual %s, see buffer %S" output (buffer-name))) - ((kill-buffer)))))) + ((kill-buffer)))) + (when clean-up + (delete-file file)))) (defun package-vc--unpack-1 (pkg-desc pkg-dir) "Prepare PKG-DESC that is already checked-out in PKG-DIR. -- 2.39.2