From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: help regarding babel to set in-buffer specific keybinding Date: Wed, 8 Feb 2012 16:10:23 +0000 Message-ID: <87haz171cg.fsf@ucl.ac.uk> References: <87ty31nzor.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvBJq-00059B-1h for emacs-orgmode@gnu.org; Wed, 08 Feb 2012 12:28:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvBJj-0007Sd-Uu for emacs-orgmode@gnu.org; Wed, 08 Feb 2012 12:28:34 -0500 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:59722 helo=TX2EHSOBE002.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvBJj-0007Rj-Qf for emacs-orgmode@gnu.org; Wed, 08 Feb 2012 12:28:27 -0500 In-Reply-To: <87ty31nzor.fsf@gmx.com> (Eric Schulte's message of "Wed, 8 Feb 2012 07:34:45 -0700") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Thomas Alexander Gerds , emacs-orgmode@gnu.org Eric Schulte writes: > Thomas Alexander Gerds 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)