How to change the language of a result of ":results output code" in emacs org-mode
Asked Answered
R

1

6

I have a org file which contains a block like this:

#+BEGIN_SRC sh :exports results :results output code
sed -n '9,36 p' ./code/convert.c
#+END_SRC

C-c C-c on the BEGIN_SRC will give me the following result:

#+RESULTS:
#+begin_src sh
 // here is some C code
#+end_src

How to change the language of a result of ":results output code" so that I can get an output like this:

#+RESULTS:
#+begin_src C
 // here is some C code
#+end_src
Rhythmandblues answered 22/6, 2021 at 14:39 Comment(0)
R
8
#+BEGIN_SRC sh :exports results :results output code :wrap SRC C
sed -n '9,36 p' ./code/convert.c
#+END_SRC

the SRC of #+BEGIN_SRC and #+END_SRC be replaced by :wrap XXX will #+BEGIN_XXX and #+END_XXX

Rhythmandblues answered 22/6, 2021 at 14:57 Comment(2)
In my case, I found only the flags :results output :wrap src C to be necessary.Hendrika
I also need to export that segment as htmlRhythmandblues

© 2022 - 2024 — McMap. All rights reserved.