emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] support insert link without write result to :file link


From: Berry, Charles
Subject: Re: [O] [PATCH] support insert link without write result to :file link
Date: Thu, 29 Mar 2018 16:30:04 +0000

> On Mar 28, 2018, at 8:39 PM, stardiviner <address@hidden> wrote:
> 
> `:results file` will write non-empty result to `:file`. But `:results link` 
> don't, it just insert a link of `:file` at result. And that is what I want to 
> solve in the first post of this thread.


The :post header arg will allow this. 

In the examples below the first code line in the src block writes a file that 
is not subsequently overwritten.

#+name: file-output
#+begin_src emacs-lisp  
(org-babel-result-to-file *this*) 
#+end_src

#+begin_src R :results raw :post file-output()
cat("this is a test",file="testit.out")
"testit.out"
#+end_src

#+RESULTS:
[[file:testit.out]]


#+name: file-output2
#+begin_src emacs-lisp :var fname="xxx" 
(org-babel-result-to-file fname) 
#+end_src

#+begin_src R :results raw :post file-output2("testit2.out")
cat("this is a test",file="testit2.out")
#+end_src

#+RESULTS:
[[file:testit2.out]]

HTH,

Chuck



reply via email to

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