From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [PATCH] minor patch to org-babel-load-file Date: Thu, 20 Jun 2013 09:58:01 -0600 Message-ID: <87txkssrjq.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UphGU-0001q0-9r for emacs-orgmode@gnu.org; Thu, 20 Jun 2013 11:59:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UphGS-0007lB-RK for emacs-orgmode@gnu.org; Thu, 20 Jun 2013 11:59:14 -0400 Received: from mail-pb0-x22a.google.com ([2607:f8b0:400e:c01::22a]:58498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UphGS-0007l2-Lu for emacs-orgmode@gnu.org; Thu, 20 Jun 2013 11:59:12 -0400 Received: by mail-pb0-f42.google.com with SMTP id un1so6408322pbc.15 for ; Thu, 20 Jun 2013 08:59:11 -0700 (PDT) In-Reply-To: (Michael Brand's message of "Tue, 18 Jun 2013 10:14:36 +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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Brand Cc: Org-mode Mode Michael Brand writes: > Hi Levin > > On Tue, Jun 18, 2013 at 9:44 AM, Levin Du wrote: >> Below is the patch that solves this problem. > > Recently I also noticed a regression of org-babel-load-file that is > resolved with your patch. Thank you for saving me of one of my TODOs. > This patch doesn't fix the actual cause of this bug. The problem stems from commit 693dda67 [1], and I've just pushed up a fix in commit a79fd4be [2]. Thanks to both of your for raising this issue. Footnotes: [1] commit 693dda67e60530c9f7b2510f44f6d14595473e28 Author: Achim Gratz Date: Fri Jun 7 22:19:38 2013 +0200 ob-core: allow language specific header arguments in properties * lisp/ob-core.el (org-babel-insert-header-arg, org-babel-parse-src-block-match): Replace `if' with empty else part by `when' for readability. (org-babel-params-from-properties): Inquire for language specific and default header properties. Language specific header properties take precedence over default header properties and old-style header property specifications. This allows for header arguments to be specified as properties (including inheritance). #+PROPERTY: header-args :cache "no" #+PROPERTY: header-args:R :session "*R-property*" :PROPERTIES: :header-args: :cache "yes" :header-args:R: :session "*R-drawer*" :END: [2] commit a79fd4be2863a300c88218b40b1adca23d9e1eb8 Author: Eric Schulte Date: Thu Jun 20 09:53:56 2013 -0600 fix babel merge params bug from commit 693dda67 The `org-babel-params-from-properties' command was calling `org-babel-merge-params', the output of which was then being fed back to another call to `org-babel-merge-params'. The merge params function is not designed to allow this form of recursive calling, and as a result many variables were being set to empty values. The first noticed side effect of this bug was the breakage of the org-babel-load-file command, which relies on default header arguments (namely :tangle), which were overwritten by the bug above. The fix involved having the `org-babel-params-from-properties' function return a list of alists, which may then all be handed to the top-level merge-params call. * lisp/ob-core.el (org-babel-params-from-properties): Now returns a list of alists and does *not* call `org-babel-merge-params'. (org-babel-parse-src-block-match): Handle new list of lists output of `org-babel-params-from-properties'. (org-babel-parse-inline-src-block-match): Handle new list of lists output of `org-babel-params-from-properties'. * lisp/ob-exp.el (org-babel-exp-src-block): Handle new list of lists output of `org-babel-params-from-properties'. (org-babel-exp-non-block-elements): Handle new list of lists output of `org-babel-params-from-properties'. * lisp/ob-lob.el (org-babel-lob-execute): Handle new list of lists output of `org-babel-params-from-properties'. -- Eric Schulte http://cs.unm.edu/~eschulte