From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lawrence Bottorff Subject: tangle versus org-babel-load-file Date: Tue, 3 Apr 2018 08:54:39 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000009f00970568f135a3" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3LSU-0001V1-0i for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 08:54:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3LSS-0003WR-Sn for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 08:54:42 -0400 Received: from mail-ot0-x22a.google.com ([2607:f8b0:4003:c0f::22a]:38526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3LSS-0003VM-N8 for emacs-orgmode@gnu.org; Tue, 03 Apr 2018 08:54:40 -0400 Received: by mail-ot0-x22a.google.com with SMTP id o9-v6so19236275otj.5 for ; Tue, 03 Apr 2018 05:54:40 -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 Mailinglist --0000000000009f00970568f135a3 Content-Type: text/plain; charset="UTF-8" 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. LB --0000000000009f00970568f135a3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm experimenting with Uncle Dave's config wh= ich is using a minimum init.el to launch conf= ig.org, which is full of elisp babel source blocks. Here's his rele= vant launching code:

(when (file-readable-p "= ~/.emacs.d/config.org")
= =C2=A0 (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-fil= e-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 doin= g other than running all the code blocks in a file? And then there's th= e :tangle yes parameter on an individual code block. I'm missing someth= ing here. It seems org-babel-load-file is creating a config.el from the config.org -- which is a tangle behavior.

LB
--0000000000009f00970568f135a3-- 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