summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2013-03-19 10:31:23 +0100
committerBastien Guerry <bzg@altern.org>2013-03-19 10:31:23 +0100
commit1e916b72937c99f093380503027b5c1d92c6b6cb (patch)
tree1b528568bce8862b619ac397079fefc5c3da00d2
parenta6e1f67d345bece3a9aafa1e9ec62d47daa4aa06 (diff)
downloadorg-mode-1e916b72937c99f093380503027b5c1d92c6b6cb.tar.gz
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.
-rw-r--r--lisp/ox-texinfo.el21
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index da478d7..3c63fe5 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -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)))))