From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: link abbreviation with multiple params, e. g. for geo locations Date: Wed, 22 May 2013 19:03:09 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=089e0141a0a85118a804dd518ad3 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfCRX-0007qP-VG for emacs-orgmode@gnu.org; Wed, 22 May 2013 13:03:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfCRT-0000Zp-Lu for emacs-orgmode@gnu.org; Wed, 22 May 2013 13:03:15 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:33196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfCRT-0000X9-9i for emacs-orgmode@gnu.org; Wed, 22 May 2013 13:03:11 -0400 Received: by mail-lb0-f170.google.com with SMTP id t13so2378336lbd.1 for ; Wed, 22 May 2013 10:03:09 -0700 (PDT) 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: Org Mode --089e0141a0a85118a804dd518ad3 Content-Type: text/plain; charset=ISO-8859-1 Hi all On Tue, May 7, 2013 at 12:29 AM, Christian Moe wrote: > I'm afraid knowing that doesn't help much. The problem is, you don't know > what point the inline call is at, so you cannot point org-entry-get to > the right entry. If you try > > : (org-entry-get (point) "geo") > > it will look for a geo property in the outline entry the source block is > in, not in the entry the call comes from. > > I don't know any easy way to pass a parameter to a source block from an > outline entry property via an inline call in that entry. Others may know > better. After some trials it seemed to me that it is enough to just add a "loc (point-marker)" to a "let" of org-babel-ref-resolve. Now when the Lisp variable loc ("Location Of Call") is used as the first argument of org-entry-get it reads the property from that entry where the code block has been called. With this, Babel perfectly covers every requirement of my use case described earlier in this thread. Please review and comment my attached patch containing doc and ERT. Michael --089e0141a0a85118a804dd518ad3 Content-Type: text/plain; charset=US-ASCII; name="0001-Entry-properties-as-code-block-arguments-in-Babel.patch.txt" Content-Disposition: attachment; filename="0001-Entry-properties-as-code-block-arguments-in-Babel.patch.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_hh0rdp4l0 RnJvbSAxNzhkOGM3MTAwMTc2NTYxYTM5NWQ1NDVjMTkzZWEzNjIyNWFiODFjIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNaWNoYWVsIEJyYW5kIDxtaWNoYWVsLmNoLmJyYW5kQGdtYWls LmNvbT4KRGF0ZTogV2VkLCAyMiBNYXkgMjAxMyAxODo1OToyNCArMDIwMApTdWJqZWN0OiBbUEFU Q0hdIEVudHJ5IHByb3BlcnRpZXMgYXMgY29kZSBibG9jayBhcmd1bWVudHMgaW4gQmFiZWwKCiog ZG9jL29yZy50ZXhpICh2YXIpOiBEb2N1bWVudCBsb2MgKCJMb2NhdGlvbiBPZiBDYWxsIikuCiog bGlzcC9vYi1yZWYuZWwgKG9yZy1iYWJlbC1yZWYtcmVzb2x2ZSk6IEFkZCBgbG9jJyB3aGljaCBp cyBzZXQgdG8KcG9pbnQgYXMgYSBtYXJrZXIgb2JqZWN0LgoqIHRlc3RpbmcvZXhhbXBsZXMvYmFi ZWwub3JnOiBBZGQgdGVzdCBlbnRyeSBmb3IgRVJULgoqIHRlc3RpbmcvbGlzcC90ZXN0LW9iLWV4 cC5lbDogQWRkIGV4cGVjdGVkIGNvZGUgYmxvY2sgcmVzdWx0cyBmb3IKRVJULgotLS0KIGRvYy9v cmcudGV4aSAgICAgICAgICAgICAgICB8ICAgIDkgKysrKysrKysrCiBsaXNwL29iLXJlZi5lbCAg ICAgICAgICAgICAgfCAgICA0ICsrKy0KIHRlc3RpbmcvZXhhbXBsZXMvYmFiZWwub3JnICB8ICAg MzAgKysrKysrKysrKys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