emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sam Ritchie <sritchie09@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] fix for ignored header args in org-babel-tangle
Date: Sat, 18 Apr 2015 18:38:44 -0600	[thread overview]
Message-ID: <5532F914.5020505@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2296 bytes --]

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 <http://www.paddleguru.com/>
Twitter <http://twitter.com/paddleguru>// Facebook 
<http://facebook.com/paddleguru>

[-- Attachment #2: Type: text/html, Size: 5406 bytes --]

             reply	other threads:[~2015-04-19  0:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-19  0:38 Sam Ritchie [this message]
2015-04-23 19:55 ` [PATCH] fix for ignored header args in org-babel-tangle Nicolas Goaziou
2015-04-24  1:45   ` Charles C. Berry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5532F914.5020505@gmail.com \
    --to=sritchie09@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).