emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Eric Schulte <eric.schulte@gmx.com>
Cc: Thomas Alexander Gerds <tagteam@sund.ku.dk>, emacs-orgmode@gnu.org
Subject: Re: help regarding babel to set in-buffer specific keybinding
Date: Wed, 8 Feb 2012 16:10:23 +0000	[thread overview]
Message-ID: <87haz171cg.fsf@ucl.ac.uk> (raw)
In-Reply-To: <87ty31nzor.fsf@gmx.com> (Eric Schulte's message of "Wed, 8 Feb 2012 07:34:45 -0700")

Eric Schulte <eric.schulte@gmx.com> writes:

> Thomas Alexander Gerds <tagteam@sund.ku.dk> writes:

[...]

>> now, I would like to tell org to evaluate the lisp code at startup, when
>> the org-file is opened. can this be achieved? particularly, is there a
>> startup special line which tells org to evaluate the lisp src block?  I
>> could add a suitable function to org-mode-hook, but is this the
>> recommended way?
>> Tomy
>>
> There is not currently any support for evaluating specific code blocks
> on buffer open.  You could move your elisp code into a
> buffer-local-variable block (which can house functions) and which are
> evaluated when buffers are opened.  I believe all changes made in such
> blocks are buffer local, so that may be your best bet.

and I would be uncomfortable having code execute automatically upon
visiting an org file...

however, I would imagine it should be possible to add something to
org-mode-hook that would execute a predefined src code block, e.g. maybe
one named "startup" or probably a bit more specific?  I wouldn't know
the babel invocation required, mind you, but I'm others can help here!

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.92.1
: using Org-mode version 7.8.03 (release_7.8.03.325.g5847)

  reply	other threads:[~2012-02-08 17:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  7:34 help regarding babel to set in-buffer specific keybinding Thomas Alexander Gerds
2012-02-08 14:34 ` Eric Schulte
2012-02-08 16:10   ` Eric S Fraga [this message]
2012-02-08 23:32     ` Torsten Wagner
2012-02-09  7:14   ` Thomas Alexander Gerds

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=87haz171cg.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=eric.schulte@gmx.com \
    --cc=tagteam@sund.ku.dk \
    /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).