emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* babel srcname? Calling Library of Babel code?
@ 2015-10-06  3:43 Lawrence Bottorff
  2015-10-06  5:15 ` Thomas S. Dye
  0 siblings, 1 reply; 5+ messages in thread
From: Lawrence Bottorff @ 2015-10-06  3:43 UTC (permalink / raw)
  To: emacs-orgmode Mailinglist

[-- Attachment #1: Type: text/plain, Size: 1362 bytes --]

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
<http://orgmode.org/manual/Evaluating-code-blocks.html> has no examples and
confused me.

This example
<https://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg00466.html> 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

[-- Attachment #2: Type: text/html, Size: 2130 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-06 19:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-06  3:43 babel srcname? Calling Library of Babel code? Lawrence Bottorff
2015-10-06  5:15 ` Thomas S. Dye
2015-10-06 18:16   ` Lawrence Bottorff
2015-10-06 18:59     ` Nick Dokos
2015-10-06 19:00     ` Thomas S. Dye

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).