unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / Atom feed
* how to remove automatically an intermediate odt-File
@ 2020-09-09 14:42 Rainer Thiel
  2020-09-13  5:14 ` Kyle Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: Rainer Thiel @ 2020-09-09 14:42 UTC (permalink / raw)
  To: [Orgmode]

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.thiel@uni-jena.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how to remove automatically an intermediate odt-File
  2020-09-09 14:42 how to remove automatically an intermediate odt-File Rainer Thiel
@ 2020-09-13  5:14 ` Kyle Meyer
       [not found]   ` <CADqAsTmRxj_CNbHB0XROBKW_uzPHxqsDwJKFD0SyUvtvnHyrdw@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Kyle Meyer @ 2020-09-13  5:14 UTC (permalink / raw)
  To: r.thiel; +Cc: emacs-orgmode

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 (&optional in-file &rest _)
                  (when in-file
                    (delete-file in-file)))
                '((name . "org-odt-convert--delete-odt")))


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Fwd: how to remove automatically an intermediate odt-File
       [not found]     ` <87imchn26k.fsf@kyleam.com>
@ 2020-09-14  6:07       ` Rainer Thiel
  0 siblings, 0 replies; 3+ messages in thread
From: Rainer Thiel @ 2020-09-14  6:07 UTC (permalink / raw)
  To: [Orgmode]

---------- Forwarded message ---------
Von: Kyle Meyer <kyle@kyleam.com>
Date: So., 13. Sept. 2020 um 17:09 Uhr
Subject: Re: how to remove automatically an intermediate odt-File
To: <r.thiel@uni-jena.de>


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 (&optional in-file &rest _)
                     (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.thiel@uni-jena.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-14  6:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09 14:42 how to remove automatically an intermediate odt-File Rainer Thiel
2020-09-13  5:14 ` Kyle Meyer
     [not found]   ` <CADqAsTmRxj_CNbHB0XROBKW_uzPHxqsDwJKFD0SyUvtvnHyrdw@mail.gmail.com>
     [not found]     ` <87imchn26k.fsf@kyleam.com>
2020-09-14  6:07       ` Fwd: " Rainer Thiel

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git