emacs-orgmode
[Top][All Lists]
Advanced

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

[O] babel srcname? Calling Library of Babel code?


From: Lawrence Bottorff
Subject: [O] babel srcname? Calling Library of Babel code?
Date: Tue, 6 Oct 2015 03:43:23 +0000

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 = {%
>           <<to>>},
. . .
>     opening = {<<opening>>},
>     closing = {<<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

reply via email to

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