From mboxrd@z Thu Jan 1 00:00:00 1970 From: "grewil3 ." Subject: automatically run code blocks when loading an org-mode document Date: Fri, 22 Jul 2016 23:11:37 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114bd63e4febdd05383fe145 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQhjP-000329-RA for emacs-orgmode@gnu.org; Fri, 22 Jul 2016 17:11:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQhjO-0001pi-Vv for emacs-orgmode@gnu.org; Fri, 22 Jul 2016 17:11:39 -0400 Received: from mail-vk0-x22c.google.com ([2607:f8b0:400c:c05::22c]:33197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQhjO-0001pc-Rc for emacs-orgmode@gnu.org; Fri, 22 Jul 2016 17:11:38 -0400 Received: by mail-vk0-x22c.google.com with SMTP id x130so173983314vkc.0 for ; Fri, 22 Jul 2016 14:11:38 -0700 (PDT) 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" To: emacs-orgmode@gnu.org --001a114bd63e4febdd05383fe145 Content-Type: text/plain; charset=UTF-8 Hi! When I load the document below, I first need to manually evaluate the code block before I can use the links. I would like the code block to be automatically evaluated when I load the document, making the links usable at once. Is there some clever in-buffer-setting I can use, to specify that I want the block called on loading, some kind of post-load hook? #+BEGIN_SRC emacs-lisp (defun handy-stuff(arg) (message arg)) #+END_SRC [[elisp:(handy-stuff "foo")][foo]] [[elisp:(handy-stuff "bar")][bar]] --001a114bd63e4febdd05383fe145 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi! When I load the document below, I first need to m= anually evaluate the code block before I can use the links. I would like th= e code block to be automatically evaluated when I load the document, making= the links usable at once.

Is there some clever in= -buffer-setting I can use, to specify that I want the block called on loadi= ng, some kind of post-load hook?

#+BEGIN_SRC emacs-lisp=
(defun handy-stuff(arg)
=C2=A0 (message arg))
#+EN= D_SRC

[[elisp:(handy-stuff "foo")][foo]]=
[[elisp:(handy-stuff "bar")][bar]]

--001a114bd63e4febdd05383fe145--