Ihor Radchenko <yanta...@gmail.com> writes:

> See the code below:
>
> #+NAME: ansi-escape-filter
> #+begin_src emacs-lisp :var data=""
> (with-temp-buffer
>   (insert data)
>   (ansi-color-apply-on-region (point-min) (point-max))
>   (buffer-string))
> #+end_src
>
> #+RESULTS: ansi-escape-filter
>
> #+begin_src sh :dir /sudo::  :results output :post  
> ansi-escape-filter(data=*this*)
> tree /var/spool/postfix/
> #+end_src
>
> `:results output` is needed to avoid parsing the shell output as a
> table.
> `data=*this*` is needed to pass the output to `ansi-escape-filter`. You
> can also check the example in the org info page for the :post header
> argument.
>
>
> Best,
> Ihor
>

Thanks for your detailed explanation. After your hint, I just checked
out =org-manual.org= about the Post-processing :post example. It's a
good example.

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
      

Reply via email to