Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Rainer M Krug <rai...@krugs.de> writes:
>
>> Please find attached the below described patch including the fix for the
>> error reported - function raises error when property value is numeric.
>
> Looks good. Thank you.

Thanks.

>
From 6461f4de49fbcd002913a58ac5b47453e965ac0d Mon Sep 17 00:00:00 2001
From: "Rainer M. Krug" <r.m.k...@gmail.com>
Date: Tue, 10 Feb 2015 09:32:46 +0100
Subject: [PATCH] ob-core.el: Fix numeric error and add header-args

* lisp/ob-core.el (org-babel-view-src-block-info): when a property
  value was numeric, an error was raised. Fixed by converting property
  value to string before evauation.

* lisp/ob-core.el (org-babel-view-src-block-info): Add property string
  "header args" to output of org-babel-view-src-block-info to make
  debugging of header-args setting problems easier.

* lisp/ob-core.el (org-babel-view-src-block-info): Add property string
  for language specific "header args:LANG" to output of org-babel-view-src-block-info to make
  debugging of header-args setting problems easier.
---
 lisp/ob-core.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index ceda1aa..aa39c11 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -409,12 +409,16 @@ a window into the `org-babel-get-src-block-info' function."
 	      (header-args (nth 2 info)))
 	  (when name            (funcall printf "Name: %s\n"     name))
 	  (when lang            (funcall printf "Lang: %s\n"     lang))
+	  (funcall printf "Properties:\n")
+	  (funcall printf "\t:header-args \t%s\n" (org-entry-get (point) "header-args" t))
+	  (funcall printf "\t:header-args:%s \t%s\n" lang (org-entry-get (point) (concat "header-args:" lang) t))
+
 	  (when (funcall full switches) (funcall printf "Switches: %s\n" switches))
 	  (funcall printf "Header Arguments:\n")
 	  (dolist (pair (sort header-args
 			      (lambda (a b) (string< (symbol-name (car a))
 						     (symbol-name (car b))))))
-	    (when (funcall full (cdr pair))
+	    (when (funcall full (format "%s" (cdr pair)))
 	      (funcall printf "\t%S%s\t%s\n"
 		       (car pair)
 		       (if (> (length (format "%S" (car pair))) 7) "" "\t")
-- 
2.3.0

> Could you provide an appropriate commit message?

Here is the patch attached with the commit message - hope it is OK.

> Bonus points if you also add a test.

Are there some guidelines on how to write tests? Never done this before...

Rainer

>
> Regards,

-- 
Rainer M. Krug
email: Rainer<at>krugs<dot>de
PGP: 0x0F52F982

Attachment: signature.asc
Description: PGP signature

Reply via email to