emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <Rainer@krugs.de>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH]: BUG fix and Add header-args property to source block info
Date: Tue, 10 Feb 2015 22:58:39 +0100	[thread overview]
Message-ID: <m2y4o5cttc.fsf@krugs.de> (raw)
In-Reply-To: <871tlxxxd6.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 10 Feb 2015 22:36:21 +0100")


[-- Attachment #1.1: Type: text/plain, Size: 293 bytes --]

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Rainer M Krug <Rainer@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.

>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: Patch with commit message --]
[-- Type: text/x-patch, Size: 2007 bytes --]

From 6461f4de49fbcd002913a58ac5b47453e965ac0d Mon Sep 17 00:00:00 2001
From: "Rainer M. Krug" <R.M.Krug@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


[-- Attachment #1.3: Type: text/plain, Size: 343 bytes --]


> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

  reply	other threads:[~2015-02-10 21:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10  9:09 [PATCH]: Add header-args property to source block info Rainer M Krug
2015-02-10 13:39 ` [PATCH]: BUG fix and " Rainer M Krug
2015-02-10 21:36   ` Nicolas Goaziou
2015-02-10 21:58     ` Rainer M Krug [this message]
2015-02-11 12:10       ` Alan Schmitt
2015-02-12  9:34         ` Rainer M Krug
2015-02-12  9:36       ` Rainer M Krug
2015-02-12 18:27         ` Charles C. Berry
2015-02-12 23:45         ` Nicolas Goaziou
2015-02-13  9:21           ` Rainer M Krug
2015-02-13  9:36             ` Sebastien Vauban
2015-02-13  9:51               ` Rainer M Krug
2015-02-10 17:58 ` [PATCH]: " Charles C. Berry
2015-02-10 20:54   ` Rainer M Krug

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=m2y4o5cttc.fsf@krugs.de \
    --to=rainer@krugs.de \
    --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).