[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] How to write a org babel hook, which can manupulate result
From: |
Feng Shu |
Subject: |
Re: [O] How to write a org babel hook, which can manupulate result |
Date: |
Thu, 27 Mar 2014 08:06:23 +0800 |
User-agent: |
Gnus/5.13001 (Ma Gnus v0.10) Emacs/24.3.50 (gnu/linux) |
Daimrod <address@hidden> writes:
> Feng Shu <address@hidden> writes:
>
>> Hi:
> Hi Feng,
>
> Look at the :post header argument.
> (info "(org) post")
How to use elisp in :post directly,
for example:
#+begin_src R :results output raw drawer :post (align-multi-table)
<content>
#+end_src
#+begin_comment
(defun align-multi-table (&optional content)
(interactive)
(let ((content (or content *this*)))
(with-temp-buffer
(insert content)
(goto-char (point-min))
(while (not (eobp))
(when (org-at-table-p)
(org-table-align))
(forward-line))
(buffer-string))))
#+end_comment
>
>> I want to write a hook to menupulate org babel output,
>> The problem is: How can I get two points info: [pointA] and [pointB]
>> in my hook function?
>>
>> #+begin_src R :results output raw drawer
>> tbl <- data.frame(a=c(1,2,3),b=c(3,2,1))
>> print(ascii(tbl),type="org")
>> #+END_SRC
>>
>> #+RESULTS:
>> :RESULTS:
>> [pointA]
>> | | a | b |
>> |---+------+------|
>> | 1 | 1.00 | 3.00 |
>> | 2 | 2.00 | 2.00 |
>> | 3 | 3.00 | 1.00 |
>> [pointB]
>> :END:
--