[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [babel] would like to to do simple text block expansion with par
Re: [O] [babel] would like to to do simple text block expansion with parameters or multiline macro replacement text
Sat, 21 Apr 2012 11:33:40 -0400
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)
"Olaf.Hamann" <address@hidden> writes:
>> I think I will try to adapt m4 as org-language so that it can be used
>> for executing src-blocks.
> m4 is no solution as it does not support multibyte character
I missed the beginning of this thread, but would the following very
simple support for text block evaluation be sufficient?
(defun org-babel-expand-body:text (body params)
(let ((name (symbol-name (car pair)))
(value (cdr pair)))
(concat "\$" (regexp-quote name))
(if (stringp value) value (format "%S" value))
(mapcar #'cdr (org-babel-get-header params :var)))
(defun org-babel-execute:text (body params)
(org-babel-expand-body:text body params))
#+begin_src text :var name="Eric"
Hi, my name is $name.
: Hi, my name is Eric.