From mboxrd@z Thu Jan 1 00:00:00 1970 From: Levin Du Subject: [PATCH] minor patch to org-babel-load-file Date: Tue, 18 Jun 2013 15:44:20 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b342c908da2bb04df68e1b2 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoqaY-0007Zk-R2 for emacs-orgmode@gnu.org; Tue, 18 Jun 2013 03:44:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoqaU-0000YM-A4 for emacs-orgmode@gnu.org; Tue, 18 Jun 2013 03:44:26 -0400 Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]:56915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoqaU-0000Y1-2Q for emacs-orgmode@gnu.org; Tue, 18 Jun 2013 03:44:22 -0400 Received: by mail-la0-f52.google.com with SMTP id fo12so3175968lab.25 for ; Tue, 18 Jun 2013 00:44:20 -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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode Mode --047d7b342c908da2bb04df68e1b2 Content-Type: text/plain; charset=ISO-8859-1 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 --047d7b342c908da2bb04df68e1b2 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi, all

I = find org-babel-load-file not work for my emacs-starter-kit =A0org file.
After some traces, I find that=A0

=A0 =A0(org-babel-merge-params nil nil nil)
=
returns:

=A0 =A0((:comments .= "") (:shebang . "") (:cache . "") (:padline = . "") (:noweb . "") (:tangle . "") (:exports = . "") (:results . ""))

which will override my default (:tangle "yes= ") value in org-babel-default-header-args
and org-babe= l-load-file simply don't tangle source blocks without ":tangle yes= ".

Below is the patch that solves this problem= .

diff =A0a/lisp/ob-core.el b/lisp/ob-core.e= l
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -2337,7 +2337,8 @@ parameters when merging lists."
= =A0 =A0 =A0 (lambda (hd)
=A0 =A0 =A0 =A0 (let ((key (intern (conc= at ":" (symbol-name hd))))
=A0 =A0 =A0 (val (eval hd)))
- (setf params (con= s (cons key (mapconcat 'identity val " ")) params))))
+ (when val
+ (setf params (cons (c= ons key (mapconcat 'identity val " ")) params)))))
=A0 =A0 =A0 '(results exports tangle noweb padline cache shebang c= omments))
=A0 =A0 =A0params))
=A0
--
Best Regards,
Levin
--047d7b342c908da2bb04df68e1b2--