From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] Why #+name: is not a member of params? Date: Tue, 05 Jun 2012 18:42:22 -0600 Message-ID: <87txypqnip.fsf@gmx.com> References: <006001cd437a$03917d70$0ab47850$@us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36644) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc4OM-0004wK-O2 for emacs-orgmode@gnu.org; Tue, 05 Jun 2012 20:50:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sc4KU-0001sS-Fl for emacs-orgmode@gnu.org; Tue, 05 Jun 2012 20:46:30 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:54042) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Sc4KU-0001s6-8Z for emacs-orgmode@gnu.org; Tue, 05 Jun 2012 20:42:30 -0400 In-Reply-To: <006001cd437a$03917d70$0ab47850$@us> (Mikhail Titov's message of "Tue, 5 Jun 2012 19:19:17 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Mikhail Titov Cc: emacs-orgmode@gnu.org "Mikhail Titov" writes: > Hello! > > I=E2=80=99d 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 f= unction) with > > (cdr (assq :name params)) > > But apparently it does not work. When I do C-c C-v C-v trying to expand b= ody, 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, --=20 Eric Schulte http://cs.unm.edu/~eschulte