emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Lawrence Bottorff <borgauf@gmail.com>
To: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: babel srcname? Calling Library of Babel code?
Date: Tue, 6 Oct 2015 03:43:23 +0000	[thread overview]
Message-ID: <CAFAhFSX5xgLzEZE=dU3gYb2v5rWsO6bOjsKtcrorCJoS3GX7jg@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2015-10-06  3:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06  3:43 Lawrence Bottorff [this message]
2015-10-06  5:15 ` babel srcname? Calling Library of Babel code? 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFAhFSX5xgLzEZE=dU3gYb2v5rWsO6bOjsKtcrorCJoS3GX7jg@mail.gmail.com' \
    --to=borgauf@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).