emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] fix for ignored header args in org-babel-tangle
@ 2015-04-19  0:38 Sam Ritchie
  2015-04-23 19:55 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ritchie @ 2015-04-19  0:38 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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 --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix for ignored header args in org-babel-tangle
  2015-04-19  0:38 [PATCH] fix for ignored header args in org-babel-tangle Sam Ritchie
@ 2015-04-23 19:55 ` Nicolas Goaziou
  2015-04-24  1:45   ` Charles C. Berry
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2015-04-23 19:55 UTC (permalink / raw)
  To: Sam Ritchie; +Cc: emacs-orgmode

Hello,

Sam Ritchie <sritchie09@gmail.com> writes:

> 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:

Thank you. 

Would you mind providing your patch with "git format-patch" and follow
guidelines at

  http://orgmode.org/worg/org-contribute.html

for the commit message (e.g., you need to add TINYCHANGE at its end if
you didn't sign FSF papers yet).

Eventually, could you write a test for this? See
"testing/lisp/test-ob-tangle.el".


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fix for ignored header args in org-babel-tangle
  2015-04-23 19:55 ` Nicolas Goaziou
@ 2015-04-24  1:45   ` Charles C. Berry
  0 siblings, 0 replies; 3+ messages in thread
From: Charles C. Berry @ 2015-04-24  1:45 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Sam Ritchie, emacs-orgmode

On Thu, 23 Apr 2015, Nicolas Goaziou wrote:

> Hello,
>
> Sam Ritchie <sritchie09@gmail.com> writes:
>
>> 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:

I think it is inverted w.r.t. '-' vs '+'

>
> Thank you.

The patch in question modifies `org-babel-parse-src-block-match', which is 
a central part of org-babel.

The patch looks innocuous, but I have a hard time believing that `:tangle 
no' is ignored - there are many places I use it.

And if header args were ignored, lots of other things would break, too.

>
> Would you mind providing your patch with "git format-patch" and follow

Maybe start with an ECM?

Chuck

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-24  1:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-19  0:38 [PATCH] fix for ignored header args in org-babel-tangle Sam Ritchie
2015-04-23 19:55 ` Nicolas Goaziou
2015-04-24  1:45   ` Charles C. Berry

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).