From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: mktemp for orgmode Date: Sat, 17 Mar 2018 15:54:05 -0700 Message-ID: References: <2018-03-17T17-12-27@devnull.Karl-Voit.at> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113cae761026020567a39a71" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exKiH-0007MV-3N for emacs-orgmode@gnu.org; Sat, 17 Mar 2018 18:54:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exKiF-0003Me-Mo for emacs-orgmode@gnu.org; Sat, 17 Mar 2018 18:54:09 -0400 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:44649) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1exKiF-0003K0-9M for emacs-orgmode@gnu.org; Sat, 17 Mar 2018 18:54:07 -0400 Received: by mail-wr0-x22c.google.com with SMTP id u46so986203wrc.11 for ; Sat, 17 Mar 2018 15:54:06 -0700 (PDT) In-Reply-To: <2018-03-17T17-12-27@devnull.Karl-Voit.at> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Karl Voit Cc: org-mode-email --001a113cae761026020567a39a71 Content-Type: text/plain; charset="UTF-8" Can you do something like: #+BEGIN_SRC some-lang :results output org drawer :file (make-temp-file "prefix-") .... #+END_SRC John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Sat, Mar 17, 2018 at 9:15 AM, Karl Voit wrote: > Hi, I sometimes wonder if there is something like mktemp[1] in > org-mode as, e.g., a built-in macro. > > For example, PlantUML in orgmode[2] requires a file header argument to > write the image output to: ":file myoutput.svg" > > In most cases, I really don't care about the output file and its > location. I just want to see it in my org-mode buffer and in various > output formats like PDF or HTML. > > When I don't want to trash my org folder, I have to use ":file > /tmp/tmp.svg". The downside of it is, that this only works for > non-Windows systems because there is no "/tmp" on Windows. > > Therefore, it would be cool to have something like {{{tmpfile}}} that > I could use in :file {{{tmpfile}}} > > However, there is still an issue with this approach: what if I need > multiple separate {{{tmpfile}}} for, e.g., multiple PlantUML blocks > that are within the same heading and therefore get exported at once? > > And: as a consequence, it would require {{{tmpdir}}} as well. > > [1] https://www.gnu.org/software/autogen/mktemp.html > [2] http://plantuml.com/emacs > > -- > get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode: > > get Memacs from https://github.com/novoid/Memacs < > Personal Information Management > http://Karl-Voit.at/tags/pim/ > Emacs-related > http://Karl-Voit.at/tags/emacs/ > > > --001a113cae761026020567a39a71 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Can you do something like:


#+BEGIN_SRC some-lang :results output org drawer :file (make-temp-f= ile "prefix-")
....
#+END_SRC


=
John

-----------------------------------
Pr= ofessor John Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical = Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-26= 8-7803

On Sat, Mar 17, 2018 at 9:15 AM, Karl Voit <= span dir=3D"ltr"><devnull@karl-voit.at> wrote:
Hi, I sometimes wonder if there is something like mktemp[1] in
org-mode as, e.g., a built-in macro.

For example, PlantUML in orgmode[2] requires a file header argument to
write the image output to: ":file myoutput.svg"

In most cases, I really don't care about the output file and its
location. I just want to see it in my org-mode buffer and in various
output formats like PDF or HTML.

When I don't want to trash my org folder, I have to use ":file
/tmp/tmp.svg". The downside of it is, that this only works for
non-Windows systems because there is no "/tmp" on Windows.

Therefore, it would be cool to have something like {{{tmpfile}}} that
I could use in :file {{{tmpfile}}}

However, there is still an issue with this approach: what if I need
multiple separate {{{tmpfile}}} for, e.g., multiple PlantUML blocks
that are within the same heading and therefore get exported at once?

And: as a consequence, it would require {{{tmpdir}}} as well.

[1] https://www.gnu.org/software/autogen/mktemp= .html
[2] http://plantuml.com/emacs

--
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-m= ode:
=C2=A0 =C2=A0 =C2=A0 =C2=A0> get Memacs from https://github.com/n= ovoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/<= br> Emacs-related > http://Karl-Voit.at/tags/emacs/



--001a113cae761026020567a39a71--