From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: babel srcname? Calling Library of Babel code? Date: Tue, 6 Oct 2015 03:43:23 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1135e3fa8e1f320521676ec5 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjJ9y-0006L6-2m for emacs-orgmode@gnu.org; Mon, 05 Oct 2015 23:43:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjJ9w-0005CU-V2 for emacs-orgmode@gnu.org; Mon, 05 Oct 2015 23:43:26 -0400 Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:34340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjJ9w-0005Bk-NV for emacs-orgmode@gnu.org; Mon, 05 Oct 2015 23:43:24 -0400 Received: by labzv5 with SMTP id zv5so136562988lab.1 for ; Mon, 05 Oct 2015 20:43:23 -0700 (PDT) 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: emacs-orgmode Mailinglist --001a1135e3fa8e1f320521676ec5 Content-Type: text/plain; charset=UTF-8 Not really getting how to call code "meta-style" from other points -- in my file, in other files, in my "library of babel" file? I've tracked down bits and pieces here and there, but I'm missing the big picture. For example, this: #+srcname: python2_env #+begin_src emacs-lisp (setq org-babel-python-command "python") (set-face-background 'modeline "#4477aa") #+end_src #+srcname: python3_env #+begin_src emacs-lisp (setq org-babel-python-command "python3") (set-face-background 'modeline "#771944") #+end_src Why is #+srcname being used and not just #+name? I assume these blocks will be called later? I'm also assuming that #+call plays a role, but this page has no examples and confused me. This example again uses #+srcname: . . . * Opening > #+srcname: opening > #+begin_src org > Dear Org mode users, > #+end_src . . . * Closing > #+srcname: closing > #+begin_src org > Yours Truly > #+end_src . . . and then . . . \setupdocument{ > to = {% > <>}, . . . > opening = {<>}, > closing = {<>} > } I'm guessing the opening and closing are being called. But again, why srcname and not just name? And what if my blocks had been defined somewhere outside of this file? LB --001a1135e3fa8e1f320521676ec5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Not really getting how to call code "meta-style"= from other points -- in my file, in other files, in my "library of ba= bel" file? I've tracked down bits and pieces here and there, but I= 'm missing the big picture.

For example, this:
=

#+srcname: python2_env
#+begin_src emacs= -lisp
=C2=A0 (setq org-babel-python-command "python")
=C2=A0 (set-face-background 'modeline "#4477aa")
#+end_src

#+srcname: python3_env
= #+begin_src emacs-lisp
=C2=A0 (setq org-babel-python-command &quo= t;python3")
=C2=A0 (set-face-background 'modeline "= #771944")
#+end_src

Why is #+= srcname being used and not just #+name? I assume these blocks will be calle= d later? I'm also assuming that #+call plays a role, but=C2=A0this page=C2= =A0has no examples and confused me.

This e= xample=C2=A0again uses #+srcname:

. . .
* Opening
> #+srcname: opening
> #+b= egin_src org
> Dear Org mode users,
> #+end_src
. . .
* Closing
> #+srcname: clo= sing
> #+begin_src org
> =C2=A0 Yours Truly
=
> #+end_src
. . .
and then

=
. . .
\setupdocument{
> =C2=A0 =C2= =A0 to =3D {%
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <<to&= gt;>},
. . .
> =C2=A0 =C2=A0 opening =3D {<<= ;opening>>},
> =C2=A0 =C2=A0 closing =3D {<<closin= g>>}
> }

I'm guessing= the opening and closing are being called. But again, why srcname and not j= ust name? And what if my blocks had been defined somewhere outside of this = file?

LB
--001a1135e3fa8e1f320521676ec5--