1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-21 06:55:35 +00:00

ox-texinfo.el: New options for removing files after compiling

* ox-texinfo.el (org-texinfo-logfiles-extensions)
(org-texinfo-remove-logfiles): New options.
(org-texinfo-compile): Use the new options to remove files
after compiling a Texinfo file.
This commit is contained in:
Bastien Guerry 2013-03-19 10:31:23 +01:00
parent a6e1f67d34
commit 1e916b7293

View File

@ -385,6 +385,23 @@ file name, %b by the file base name \(i.e without extension) and
:type '(repeat :tag "Shell command sequence"
(string :tag "Shell command")))
(defcustom org-texinfo-logfiles-extensions
'("aux" "toc" "cp" "fn" "ky" "pg" "tp" "vr")
"The list of file extensions to consider as Texinfo logfiles.
The logfiles will be remove if `org-texinfo-remove-logfiles' is
non-nil."
:group 'org-export-texinfo
:type '(repeat (string :tag "Extension")))
(defcustom org-texinfo-remove-logfiles t
"Non-nil means remove the logfiles produced by compiling a Texinfo file.
By default, logfiles are files with these extensions: .aux, .toc,
.cp, .fn, .ky, .pg and .tp. To define the set of logfiles to remove,
set `org-texinfo-logfiles-extensions'."
:group 'org-export-latex
:type 'boolean)
;;; Constants
(defconst org-texinfo-max-toc-depth 4
"Maximum depth for creation of detailed menu listings. Beyond
@ -1809,6 +1826,10 @@ Return INFO file name or an error if it couldn't be produced."
(when errors (concat ": " errors))))
;; Else remove log files, when specified, and signal end of
;; process to user, along with any error encountered.
(when org-texinfo-remove-logfiles
(dolist (ext org-texinfo-logfiles-extensions)
(let ((file (concat out-dir base-name "." ext)))
(when (file-exists-p file) (delete-file file)))))
(message (concat "Process completed"
(if (not errors) "."
(concat " with errors: " errors)))))