* [PATCH] minor patch to org-babel-load-file
@ 2013-06-18 7:44 Levin Du
2013-06-18 8:14 ` Michael Brand
0 siblings, 1 reply; 5+ messages in thread
From: Levin Du @ 2013-06-18 7:44 UTC (permalink / raw)
To: Org-mode Mode
[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]
Hi, all
I find org-babel-load-file not work for my emacs-starter-kit org file.
After some traces, I find that
(org-babel-merge-params nil nil nil)
returns:
((:comments . "") (:shebang . "") (:cache . "") (:padline . "") (:noweb
. "") (:tangle . "") (:exports . "") (:results . ""))
which will override my default (:tangle "yes") value in
org-babel-default-header-args
and org-babel-load-file simply don't tangle source blocks without ":tangle
yes".
Below is the patch that solves this problem.
diff a/lisp/ob-core.el b/lisp/ob-core.el
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2337,7 +2337,8 @@ parameters when merging lists."
(lambda (hd)
(let ((key (intern (concat ":" (symbol-name hd))))
(val (eval hd)))
- (setf params (cons (cons key (mapconcat 'identity val " ")) params))))
+ (when val
+ (setf params (cons (cons key (mapconcat 'identity val " ")) params)))))
'(results exports tangle noweb padline cache shebang comments))
params))
--
Best Regards,
Levin
[-- Attachment #2: Type: text/html, Size: 1849 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] minor patch to org-babel-load-file
2013-06-18 7:44 [PATCH] minor patch to org-babel-load-file Levin Du
@ 2013-06-18 8:14 ` Michael Brand
2013-06-20 15:58 ` Eric Schulte
0 siblings, 1 reply; 5+ messages in thread
From: Michael Brand @ 2013-06-18 8:14 UTC (permalink / raw)
To: Levin Du; +Cc: Org-mode Mode
Hi Levin
On Tue, Jun 18, 2013 at 9:44 AM, Levin Du <zslevin@gmail.com> 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.
Michael
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] minor patch to org-babel-load-file
2013-06-18 8:14 ` Michael Brand
@ 2013-06-20 15:58 ` Eric Schulte
2013-06-20 16:37 ` Michael Brand
2013-06-20 18:00 ` Achim Gratz
0 siblings, 2 replies; 5+ messages in thread
From: Eric Schulte @ 2013-06-20 15:58 UTC (permalink / raw)
To: Michael Brand; +Cc: Org-mode Mode
Michael Brand <michael.ch.brand@gmail.com> writes:
> Hi Levin
>
> On Tue, Jun 18, 2013 at 9:44 AM, Levin Du <zslevin@gmail.com> 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 <Stromeko@Stromeko.DE>
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 <schulte.eric@gmail.com>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-06-20 18:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18 7:44 [PATCH] minor patch to org-babel-load-file Levin Du
2013-06-18 8:14 ` Michael Brand
2013-06-20 15:58 ` Eric Schulte
2013-06-20 16:37 ` Michael Brand
2013-06-20 18:00 ` Achim Gratz
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).