Fwd: how to remove automatically an intermediate odt-File

2020-09-14 Thread Rainer Thiel
-- Forwarded message -
Von: Kyle Meyer 
Date: So., 13. Sept. 2020 um 17:09 Uhr
Subject: Re: how to remove automatically an intermediate odt-File
To: 


Hi Rainer,

Rainer Thiel writes:

> Thanks for the help, but I cannot get it right.  I am always getting
> the message «error: Unknown add-function location ‘org-odt-convert’».

org-odt-convert is defined in ox-odt, so if that library isn't loaded
yet, you'll need to explicitly load it before that snippet:

(require 'ox-odt)

Or you could use eval-after-load, as in the next snippet.

> Where exactly do I have to place this code snippet?  I am sorry should
> I be overlooking something obvious.

Anywhere in your Emacs customization should do.  If you wanted to avoid
loading ox-odt at startup, you do something like this:

(eval-after-load 'ox-odt
  '(advice-add 'org-odt-convert :after
   (lambda ( in-file  _)
 (when in-file
   (delete-file in-file)))
   '((name . "org-odt-convert--delete-in-file"

> Thank you very much again,

Happy to help, but in the future please keep your replies on list.  That
(1) allows others to help and give feedback and (2) may help other
readers that had the same question as you.


-- 
Prof. Dr. Rainer Thiel
Institut für Altertumswissenschaften
07737 Jena, Germany (EU)
r.th...@uni-jena.de



Re: how to remove automatically an intermediate odt-File

2020-09-12 Thread Kyle Meyer
Rainer Thiel writes:

> I have set org-odt-preferred-output-format to docx, which works fine.
> How can I have the intermediate odt-file removed automatically after
> the docx-file is created?

Here's one (lightly tested) option:

(advice-add :after #'org-odt-convert
(lambda ( in-file  _)
  (when in-file
(delete-file in-file)))
'((name . "org-odt-convert--delete-odt")))



how to remove automatically an intermediate odt-File

2020-09-09 Thread Rainer Thiel
I have set org-odt-preferred-output-format to docx, which works fine.
How can I have the intermediate odt-file removed automatically after
the docx-file is created?

Many thanks in advance for any answer

Rainer
-- 
Prof. Dr. Rainer Thiel
Institut für Altertumswissenschaften
07737 Jena, Germany (EU)
r.th...@uni-jena.de