From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Ritchie Subject: [PATCH] fix for ignored header args in org-babel-tangle Date: Sat, 18 Apr 2015 18:38:44 -0600 Message-ID: <5532F914.5020505@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------050401010608040808000203" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjdG9-0005gq-HB for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 20:38:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjdG4-0000Y6-FC for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 20:38:53 -0400 Received: from mail-ig0-x22e.google.com ([2607:f8b0:4001:c05::22e]:34676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjdG4-0000Xy-7Z for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 20:38:48 -0400 Received: by iget9 with SMTP id t9so45952639ige.1 for ; Sat, 18 Apr 2015 17:38:47 -0700 (PDT) Received: from RitchieMacBook.local (c-76-120-77-248.hsd1.co.comcast.net. [76.120.77.248]) by mx.google.com with ESMTPSA id ig15sm3889160igb.10.2015.04.18.17.38.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 18 Apr 2015 17:38:46 -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: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------050401010608040808000203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I found that all of my header arguments to source blocks were getting ignored. Moving the header-args into the let* binding seems to fix this issue, though I'm not enough of a guru to know why. Without this arguments like #+BEGIN_SRC clojure :tangle ./project.clj and #+BEGIN_SRC clojure :tangle no were getting ignored and substituted for ":tangle yes" along with other defaults. Hope this patch is in the right format: diff --git a/ob-core.el b/ob-core-old.el index ba82d88..a6ffcc4 100644 --- a/ob-core.el +++ b/ob-core-old.el @@ -1368,14 +1368,7 @@ specified in the properties of the current outline entry." (or body ""))))) (preserve-indentation (or org-src-preserve-indentation (save-match-data - (string-match "-i\\>" switches)))) - (header-args (apply #'org-babel-merge-params - org-babel-default-header-args - (when (boundp lang-headers) (eval lang-headers)) - (append - (org-babel-params-from-properties lang) - (list (org-babel-parse-header-arguments - (org-no-properties (or (match-string 4) "")))))))) + (string-match "-i\\>" switches))))) (list lang ;; get block body less properties, protective commas, and indentation (with-temp-buffer @@ -1383,7 +1376,13 @@ specified in the properties of the current outline entry." (insert (org-unescape-code-in-string body)) (unless preserve-indentation (org-do-remove-indentation)) (buffer-string))) - header-args + (apply #'org-babel-merge-params + org-babel-default-header-args + (when (boundp lang-headers) (eval lang-headers)) + (append + (org-babel-params-from-properties lang) + (list (org-babel-parse-header-arguments + (org-no-properties (or (match-string 4) "")))))) switches block-indentation))) -- Sam Ritchie (@sritchie) Paddleguru Co-Founder 703.863.8561 www.paddleguru.com Twitter // Facebook --------------050401010608040808000203 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I found that all of my header arguments to source blocks were getting ignored. Moving the header-args into the let* binding seems to fix this issue, though I'm not enough of a guru to know why. Without this arguments like

#+BEGIN_SRC clojure :tangle ./project.clj

and

#+BEGIN_SRC clojure :tangle no

were getting ignored and substituted for ":tangle yes" along with other defaults.

Hope this patch is in the right format:

diff --git a/ob-core.el b/ob-core-old.el
index ba82d88..a6ffcc4 100644
--- a/ob-core.el
+++ b/ob-core-old.el
@@ -1368,14 +1368,7 @@ specified in the properties of the current outline entry."
             (or body "")))))
      (preserve-indentation (or org-src-preserve-indentation
                    (save-match-data
-                     (string-match "-i\\>" switches))))
-         (header-args (apply #'org-babel-merge-params
-                             org-babel-default-header-args
-                             (when (boundp lang-headers) (eval lang-headers))
-                             (append
-                              (org-babel-params-from-properties lang)
-                              (list (org-babel-parse-header-arguments
-                                     (org-no-properties (or (match-string 4) ""))))))))
+                     (string-match "-i\\>" switches)))))
     (list lang
           ;; get block body less properties, protective commas, and indentation
           (with-temp-buffer
@@ -1383,7 +1376,13 @@ specified in the properties of the current outline entry."
               (insert (org-unescape-code-in-string body))
           (unless preserve-indentation (org-do-remove-indentation))
               (buffer-string)))
-      header-args
+      (apply #'org-babel-merge-params
+         org-babel-default-header-args
+         (when (boundp lang-headers) (eval lang-headers))
+         (append
+          (org-babel-params-from-properties lang)
+          (list (org-babel-parse-header-arguments
+             (org-no-properties (or (match-string 4) ""))))))
       switches
       block-indentation)))
 


--
Sam Ritchie (@sritchie)
Paddleguru Co-Founder
703.863.8561
www.paddleguru.com
Twitter // Facebook
--------------050401010608040808000203--