From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: tangle versus org-babel-load-file Date: Tue, 03 Apr 2018 12:16:40 -0400 Message-ID: <87h8osuuxj.fsf@alphaville.usersys.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3OcK-0006zf-9O for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 12:17:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3OcG-0007GZ-UP for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 12:17:04 -0400 Received: from [195.159.176.226] (port=36411 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3OcG-0007FL-Lo for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 12:17:00 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1f3Oa3-0002mr-Rh for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 18:14:43 +0200 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 Lawrence Bottorff writes: > I'm experimenting with Uncle Dave's config which is using a minimum init.el to launch config.org, which > is full of elisp babel source blocks. Here's his relevant launching code: > > (when (file-readable-p "~/.emacs.d/config.org") >   (org-babel-load-file (expand-file-name "~/.emacs.d/config.org"))) > > However, I've seen this example: > > (require 'org) > (require 'ob-tangle) > (org-babel-load-file (expand-file-name "~/.emacs.d/myemacs.org")) > > which seems to want (require 'ob-tangle). The Uncle Dave setup is working fine. I guess I don't know how > it's tangling (which means running all the code blocks in the org file, right?) without somehow being > told to. But then what is org-babel-tangle-file doing other than running all the code blocks in a file? > And then there's the :tangle yes parameter on an individual code block. I'm missing something here. It > seems org-babel-load-file is creating a config.el from the config.org -- which is a tangle behavior. > No, tangling does not run code blocks: it just writes them out to (one or many) different file(s). org-babel-load-file calls org-babel-tangle which is an autoloaded function, so when it is called, emacs arranges to load the file that defines it (i.e. ob-tange.el[c]). So you don't need to to (require 'ob-tangle) separately. I presume the (require 'org) is also unnecessary because you are loading the org-mode that is bundled with emacs which does that automatically (but I haven't used the bundled org-mode in a long time, so take this cum (the appropriately sized) grano salis). -- Nick