From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UFFkMRcwvl+tJwAA0tVLHw (envelope-from ) for ; Wed, 25 Nov 2020 10:21:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 2HJQLRcwvl9TBgAA1q6Kng (envelope-from ) for ; Wed, 25 Nov 2020 10:21:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 052E79400D3 for ; Wed, 25 Nov 2020 10:21:11 +0000 (UTC) Received: from localhost ([::1]:36324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khrvB-0006bi-Vz for larch@yhetil.org; Wed, 25 Nov 2020 05:21:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khruZ-0006bU-Iy for emacs-orgmode@gnu.org; Wed, 25 Nov 2020 05:20:31 -0500 Received: from static.rcdrun.com ([95.85.24.50]:55373) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khruX-0007jY-J4 for emacs-orgmode@gnu.org; Wed, 25 Nov 2020 05:20:31 -0500 Received: from localhost ([::ffff:41.202.241.56]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002C1AE5.000000005FBE2FEB.00005C6D; Wed, 25 Nov 2020 10:20:26 +0000 Date: Wed, 25 Nov 2020 13:19:59 +0300 From: Jean Louis To: Ihor Radchenko , Texas Cyberthal , "emacs-orgmode@gnu.org" Subject: org-sbe to automate some source block executions Message-ID: References: <87mtz84om9.fsf@localhost> <87ft4zhyuo.fsf@disroot.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: <87ft4zhyuo.fsf@disroot.org> User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Received-SPF: pass client-ip=95.85.24.50; envelope-from=bugs@gnu.support; helo=static.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.51 X-TUID: qEr6f7lJ5ABz * Eric S Fraga [2020-11-24 12:46]: > On Tuesday, 24 Nov 2020 at 12:00, Jean Louis wrote: > > Can I automated the execution of Babel code upon opening of the Org > > file? > > You can, by using file local variables. For instance, for some files, I > do this: > > #+begin_src org > ,* local variables :noexport: > # Local Variables: > # eval: (org-sbe "startup") > # End: > #+end_src > > which will evaluate the named src block "startup" when file is > opened. I am trying to implement it, do you see here anything below that I am doing wrong? Error is that it cannot find source block stages ** Stages #+BEGIN_SRC sql :var results=stages :engine postgresql :exports results SELECT -- salesflowstages_priority AS "Priority", salesflowstages_publicstage AS "Development Stages" --, -- salesflowstages_description AS "Description" FROM salesflowstages WHERE salesflowstages_salesflows = 1 ORDER BY salesflowstages_priority ASC #+END_SRC # Local Variables: # eval: (org-sbe "stages") # End: