From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Vollmar Subject: Re: #+call split into multiple lines? Date: Fri, 29 Mar 2013 09:24:19 +0100 Message-ID: <3741EDEB-8A94-4402-85D3-D74236811F97@nf.mpg.de> References: <86ip4bw6yd.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Apple-Mail-111--308783833; protocol="application/pkcs7-signature"; micalg=sha1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULUc1-0006oS-Is for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 04:24:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULUbz-0000pw-NT for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 04:24:37 -0400 Received: from mail.nf.mpg.de ([134.107.209.50]:54927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULUbz-0000pd-Eu for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 04:24:35 -0400 Received: from [192.168.0.18] ([81.13.203.60]) by mail.nf.mpg.de (Sun Java(tm) System Messaging Server 6.3-8.03 (built Apr 24 2009; 32bit)) with ESMTPSA id <0MKE0012XY0WJQ00@mail.nf.mpg.de> for emacs-orgmode@gnu.org; Fri, 29 Mar 2013 09:24:33 +0100 (MET) In-reply-to: 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: "Thomas S. Dye" , Sebastien Vauban , Achim Gratz , Nicolas Goaziou Cc: Org Mode Mailing List --Apple-Mail-111--308783833 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Dear Thomas, dear Sebation, dear Achim, dear Nicolas, maybe a misunderstanding: the original idea is to produce a "personal = homepage" for members of our institute, with one file per person - here = is a better example http://www.nf.mpg.de/cv-howto/ex3-en.org and here = some background information http://www.nf.mpg.de/cv-howto/cv-en.html. As you can see, we used MACROs for our hcard-HTML templates - this = currently does not work unless all arguments are written in one line. We = need 10+ arguments and using named arguments is a much better strategy = anyway. The problem is quite general, I think, and a common solution I quite = like is a key-value structure (preferably with optional comments), one = key-value pair per line.=20 Using a table for a key-value assignment is, of course, possible. Here = again your example:=20 #+name: card-table | cname | gname | photo | etc.| | Dr. Stefan Vollmar | Stefan | stefan-vollmar.jpg | ... | Editing a table with many columns is awkward (not everybody uses Emacs = for our templates). Much easier (to edit) is the transposed version: #+name: card-table | cname | Dr. Stefan Vollmar | | gname | Stefan | | photo | stefan-vollmar.jpg | ... This might work reasonably well - if (1) I could prevent the table from = being exported to HTML, (2) (probably more difficult) if this kind of = thing would work: #+call: hcard(v=3Dcard-table) :results html with ...

$v["cname"]

Given Name: $v["gname"]

... inside the hcard-babel-block (org) to reference the named values. My feeling is (please correct me if I am wrong) that maybe we would want = two Babel blocks: one for setting a set of variables/an array (elisp?) = and one for filling the template? Could I fill a suitable structure/array/set of variables within an elisp = block and then reference it/them in the org template that only requires = replacing placeholders? Many thanks in advance! Warm regards, Stefan On 28.03.2013, at 22:51, Thomas S. Dye wrote: >=20 >=20 > Aloha Seb, >=20 > "Sebastien Vauban" > writes: >=20 >> Hi Thomas, >>=20 >> Thomas S. Dye wrote: >>> In this situation I often put the arguments in a named Org table and >>> then write the Babel source code block to take a single = argument--the >>> table name--and parse the information passed in that way. =20 >>>=20 >>> #+name: card-table >>> | cname | gname | photo | = etc.| >>> | Dr. Stefan Vollmar | Stefan | stefan-vollmar.jpg | ... = | >>> | Dr. Stefan Vollmar, Jr. | Stefan Jr. | stefan-vollmar-jr.jpg | ... = | >>>=20 >>>=20 >>> #+call: mhead-hcard(card=3Dcard-table[0,]) for Stefan >>>=20 >>> #+call: mhead-hcard(card=3Dcard-table[1,]) for Stefan Jr. >>>=20 >>> If you don't mind writing some extra code for the Babel function, = then >>>=20 >>> #+call: mhead-hcard(card=3Dcard-table,gname=3D"Stefan") >>>=20 >>> etc. >>=20 >> And do you eventually have a way to write a "for-loop" for all the = lines of >> the tables, not being forced to write as many calls as the number of = lines you >> do have? >>=20 >> I don't see (immediately) how to do such, but that would really allow = to >> promote such a use case! >=20 > Not sure I understand your question. Perhaps I misunderstood Stefan's > use case? >=20 > There are several languages supported by Babel that have loop > constructs. I was assuming that Stefan would use one of these when I > suggested the possibility of writing some extra code. >=20 > All the best, > Tom >=20 > --=20 > Thomas S. Dye > http://www.tsdye.com >=20 >=20 --=20 Dr. Stefan Vollmar, Dipl.-Phys. Head of IT group Max-Planck-Institut f=FCr neurologische Forschung Gleueler Str. 50, 50931 K=F6ln, Germany Tel.: +49-221-4726-213 FAX +49-221-4726-298 Tel.: +49-221-478-5713 Mobile: 0160-93874279 E-Mail: vollmar@nf.mpg.de http://www.nf.mpg.de --Apple-Mail-111--308783833 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIOZTCCBCEw ggMJoAMCAQICAgDHMA0GCSqGSIb3DQEBBQUAMHExCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNEZXV0 c2NoZSBUZWxla29tIEFHMR8wHQYDVQQLExZULVRlbGVTZWMgVHJ1c3QgQ2VudGVyMSMwIQYDVQQD ExpEZXV0c2NoZSBUZWxla29tIFJvb3QgQ0EgMjAeFw0wNjEyMTkxMDI5MDBaFw0xOTA2MzAyMzU5 MDBaMFoxCzAJBgNVBAYTAkRFMRMwEQYDVQQKEwpERk4tVmVyZWluMRAwDgYDVQQLEwdERk4tUEtJ MSQwIgYDVQQDExtERk4tVmVyZWluIFBDQSBHbG9iYWwgLSBHMDEwggEiMA0GCSqGSIb3DQEBAQUA A4IBDwAwggEKAoIBAQDpm8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