emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Torsten Wagner <torsten.wagner@gmail.com>
To: emacs-orgmode@gnu.org, Eric Schulte <eric.schulte@gmx.com>,
	Thomas Alexander Gerds <tagteam@sund.ku.dk>
Subject: Re: help regarding babel to set in-buffer specific keybinding
Date: Thu, 9 Feb 2012 08:32:20 +0900	[thread overview]
Message-ID: <CAPaq-gP1kcDFDLpCxdN01E9HcqBiH7=qjhSAGjr2gOizt=fGdg@mail.gmail.com> (raw)
In-Reply-To: <87haz171cg.fsf@ucl.ac.uk>

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

Hmmm,
Recently I started to use source code blocks as a kind of init for a
certain task,  set variables,  modify stuff.  That is,  execution of a
source code block once at the beginning, e.g.  after opening an org file.
Thus, I was thinking about automatically execution too.
Would it help if there would be a approval necessary by the user.  A list
of trusted organisation files could be compared to execute a start block
without approval.
Sure there are still possible attack scenarios but that's what you pay for
more comfort ;)
Totti
On Feb 9, 2012 2:28 AM, "Eric S Fraga" <e.fraga@ucl.ac.uk> wrote:

> 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)
>
>
>

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

  reply	other threads:[~2012-02-08 23:32 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
2012-02-08 23:32     ` Torsten Wagner [this message]
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='CAPaq-gP1kcDFDLpCxdN01E9HcqBiH7=qjhSAGjr2gOizt=fGdg@mail.gmail.com' \
    --to=torsten.wagner@gmail.com \
    --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).