Oleh <ohwoeo...@gmail.com> writes: > Hi all, > > I'd like to perform Elisp operations on org-mode buffer while exporting. > > Something like this (the comma unquotes like in Lisp quasiquote): > > ,(setq foo "(defun square (x)\n (* x x))") > > #+begin_src lisp > ,foo > #+end_src > #+BEGIN_HTML > ,(with-current-buffer > (with-current-buffer (get-buffer-create "*temp*") > (lisp-mode) > (insert (upcase foo)) > (htmlize-buffer)) > (kill-buffer "*temp*") > (buffer-string)) > #+END_HTML > > And I want it to be equivalent to: > > #+begin_src lisp > (defun square (x) > (* x x)) > #+end_src > #+BEGIN_HTML > <!-- html equivalent to above code upcased and fontified --> > #+END_HTML > > Is something like this possible? > > regards, > Oleh >
The following will do what you want. set the value #+begin_src lisp :results silent (defvar foo '(defun square (x) (* x x))) #+end_src #+begin_src lisp :results output pp code foo #+end_src #+RESULTS: #+BEGIN_SRC lisp (DEFUN SQUARE (X) (* X X)) #+END_SRC Best, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D