emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: stardiviner
Subject: [O] [PATCH] support insert link without write result to :file link
Date: Tue, 27 Mar 2018 10:56:59 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

I added this patch to handle posted question case.

This will improve Org-mode links with org-babel result a lot. Make Org-mode can insert link as user want at many places.

Hope can be merged.


On 03/27/2018 02:06 AM, Michael Welle wrote:
Hello,

stardiviner <address@hidden> writes:

I tried the following example:

```

#+begin_src shell :mkdir yes :dir "data/tmp" :results file :file 
"crackzor_1.0.c.gz"
wget -c "http://ben.akrin.com/crackzor/crackzor_1.0.c.gz"
#+end_src

#+RESULTS:
[[file:data/tmp/crackzor_1.0.c.gz]]
```

But the files is empty, I check out Org-mode document about `:file` 
header argument, seems org-babel will write result to `:file` specified 
file. I wander how I can handle upper case correctly? (don't write 
result to file, just insert a link to downloaded file as a result)
well, your above example would work, at least to a certain point, if you
let wget write its output to stdout:

#+begin_src sh :mkdir yes :dir "/tmp" :results file :file "crackzor_1.0.c.gz"
wget -c "http://ben.akrin.com/crackzor/crackzor_1.0.c.gz" -O-
#+end_src

But I don't now know how to get the encoding right (I think that's the
problem). The zip file contains rubbish. What I would do instead is
something like this: 

#+begin_src sh :mkdir yes :dir "/tmp" :results raw :var fn="crackzor_1.0.c.gz"
/usr/bin/wget -c "http://ben.akrin.com/crackzor/${fn}"
echo "[[file:/tmp/${fn}]]"
#+end_src

Regards
hmw


Attachment: 0001-ob-core.el-org-babel-execute-src-block-support-resul.patch
Description: Text Data


reply via email to

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