emacs-diffs
[Top][All Lists]
Advanced

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

master 18e1455 1/2: Make generation of texi from org overwrite output


From: Glenn Morris
Subject: master 18e1455 1/2: Make generation of texi from org overwrite output
Date: Sun, 28 Feb 2021 18:39:39 -0500 (EST)

branch: master
commit 18e1455c8ae851791a047dc56eef972cc24e5b6c
Author: Glenn Morris <rgm@gnu.org>
Commit: Glenn Morris <rgm@gnu.org>

    Make generation of texi from org overwrite output
    
    * doc/misc/Makefile.in (org_template): Don't delete output.
    * lisp/org/ox-texinfo.el (org-texinfo-export-to-texinfo-batch):
    Overwrite existing output.
---
 doc/misc/Makefile.in   | 1 -
 lisp/org/ox-texinfo.el | 7 +++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/doc/misc/Makefile.in b/doc/misc/Makefile.in
index 662537b..060bffa 100644
--- a/doc/misc/Makefile.in
+++ b/doc/misc/Makefile.in
@@ -237,7 +237,6 @@ emacs = "${EMACS}" -batch --no-site-file --no-site-lisp
 # things like org-setup's "version" macro work.  Sigh.
 define org_template
  $(1:.org=.texi): $(1)
-       @rm -f $$@
        $${AM_V_GEN}cd "$${srcdir}" && $${emacs} -l ox-texinfo \
          -f org-texinfo-export-to-texinfo-batch $$(notdir $$<) $$(notdir $$@)
 endef
diff --git a/lisp/org/ox-texinfo.el b/lisp/org/ox-texinfo.el
index 78d58be..6e8d0d6 100644
--- a/lisp/org/ox-texinfo.el
+++ b/lisp/org/ox-texinfo.el
@@ -1629,17 +1629,16 @@ Return output file's name."
 
 (defun org-texinfo-export-to-texinfo-batch ()
   "Export Org file INFILE to Texinfo file OUTFILE, in batch mode.
+Overwrites existing output file.
 Usage: emacs -batch -f org-texinfo-export-to-texinfo-batch INFILE OUTFILE"
   (or noninteractive (user-error "Batch mode use only"))
   (let ((infile (pop command-line-args-left))
        (outfile (pop command-line-args-left))
-       (org-export-coding-system org-texinfo-coding-system))
+       (org-export-coding-system org-texinfo-coding-system)
+        (make-backup-files nil))
     (unless (file-readable-p infile)
       (message "File `%s' not readable" infile)
       (kill-emacs 1))
-    (when (file-exists-p outfile)
-      (message "File `%s' already exists" outfile)
-      (kill-emacs 1))
     (with-temp-buffer
       (insert-file-contents infile)
       (org-export-to-file 'texinfo outfile))))



reply via email to

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