From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [PATCH]: BUG fix and Add header-args property to source block info Date: Tue, 10 Feb 2015 22:58:39 +0100 Message-ID: References: <871tlxxxd6.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLIpj-000056-7x for emacs-orgmode@gnu.org; Tue, 10 Feb 2015 16:59:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLIpf-0002pG-6p for emacs-orgmode@gnu.org; Tue, 10 Feb 2015 16:59:03 -0500 Received: from mail-we0-f176.google.com ([74.125.82.176]:51255) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLIpf-0002oz-0a for emacs-orgmode@gnu.org; Tue, 10 Feb 2015 16:58:59 -0500 Received: by mail-we0-f176.google.com with SMTP id x3so11496105wes.7 for ; Tue, 10 Feb 2015 13:58:58 -0800 (PST) Received: from Rainers-MacBook-Pro.local (arn78-1-88-186-171-7.fbx.proxad.net. [88.186.171.7]) by mx.google.com with ESMTPSA id n10sm283174wic.11.2015.02.10.13.58.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Feb 2015 13:58:57 -0800 (PST) In-Reply-To: <871tlxxxd6.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Tue, 10 Feb 2015 22:36:21 +0100") 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 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Nicolas Goaziou writes: > Hello, > > Rainer M Krug 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. > --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ob-core.el-Fix-numeric-error-and-add-header-args.patch Content-Transfer-Encoding: quoted-printable Content-Description: Patch with commit message From=206461f4de49fbcd002913a58ac5b47453e965ac0d Mon Sep 17 00:00:00 2001 From: "Rainer M. Krug" 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. =2D-- 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 =2D-- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -409,12 +409,16 @@ a window into the `org-babel-get-src-block-info' func= tion." (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)))))) =2D (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") =2D-=20 2.3.0 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > 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, =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJU2n8fAAoJENvXNx4PUvmCyT8H/i4YLKSpTrMiaO9/tBnxMBvI Xw4wQQffRgpeLwhn0Er60Y1ERCoeYIY5BaMcaCLJTcnRq1C780c0eYYVUlpf6z0S FVDqX5eLbgI01X3tFvaBdwsbHqgtxgVpehvSywOvVEiskCf90h7sr5sIIEac0x3q 0IGT6Ry+Y3s0T1jTWye+6zv1M7JQluePe+jXD3YxUK1fnKfpVAOweP69vVS4lvY2 GkBBpxkcmTlsHHqv86LmU6POPnCXRW783XXPYTdOhS2YH/bnXnUqa2UhQQNszNPV M5X2yFM2h+MRFXhI7UfIgwn0sUdZGpWurUFUj6R7zfYyLja7z4GfFhtk7WjAg9s= =Xdsm -----END PGP SIGNATURE----- --==-=-=--