emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [babel] Why #+name: is not a member of params?


From: Eric Schulte
Subject: Re: [O] [babel] Why #+name: is not a member of params?
Date: Tue, 05 Jun 2012 18:42:22 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.97 (gnu/linux)

"Mikhail Titov" <address@hidden> writes:

> Hello!
>
> I’d like to insert a comment into tangle output with a block name. I thought 
> I could easily access it (like from org-babel-expand-body:XXX function) with
>
> (cdr (assq :name params))
>
> But apparently it does not work. When I do C-c C-v C-v trying to expand body, 
> I get nil as it is not there.
>
> Did I miss something?
>
> I want that so each block appears in individual Matlab code cell [1].
>
> [1] http://www.mathworks.com/help/techdoc/matlab_env/brqxeeu-259.html
>
> Mikhail
>

Hi Mikhail,

The code block name is not a member of params.  Params only holds header
arguments, not other meta data like the name.  The code block name is
stored in the `info' list which is active while the code block is being
processed, so you could access it with something like the following,
although which is relying on an implementation detail that is not part
of the formal spec (i.e., cheating) and could change.

#+name: foo
#+begin_src emacs-lisp
  (nth 4 info)
#+end_src

#+RESULTS: foo
: foo

Best,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



reply via email to

[Prev in Thread] Current Thread [Next in Thread]