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: Fri, 14 Jun 2013 19:54:04 +0200 Message-ID: References: <87a9n35g25.fsf@gmail.com> <87fvwuuez8.fsf@gmail.com> <87li6lelx1.fsf@gmail.com> <87ehccmoz4.fsf@gmail.com> <874nd8ph8x.fsf@gmail.com> <87wqq4l872.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnYCN-0003iI-0k for emacs-orgmode@gnu.org; Fri, 14 Jun 2013 13:54:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UnYCM-0002il-2N for emacs-orgmode@gnu.org; Fri, 14 Jun 2013 13:54:06 -0400 Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]:64640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UnYCL-0002i7-Qm for emacs-orgmode@gnu.org; Fri, 14 Jun 2013 13:54:05 -0400 Received: by mail-la0-f52.google.com with SMTP id fo12so773525lab.25 for ; Fri, 14 Jun 2013 10:54:04 -0700 (PDT) In-Reply-To: <87wqq4l872.fsf@gmail.com> 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: Eric Schulte Cc: Org Mode Hi Eric On Sat, Jun 8, 2013 at 9:21 PM, Eric Schulte wrote: > Vitalie Spinu writes: >> [...] >> `org-babel-src-block-location' >> >> or probably even more suggestive: >> >> `org-babel-src-block-beginning'. >> > > I like "current" because it is similar to other variables which are > dynamically bound by Org-mode and without it there is no indication that > it points to a block which is active *now*. > > I've changed the variable name to your previous suggestion of > `org-babel-current-src-block-location'. Thanks to all for the clarifications about the name and the improved docstring of org-babel-current-src-block-location. Now I see the good reasons for the old and the new name. According to this change and my better understanding I am rewriting and extending the ERT from my previous patch to document my use case. There is an issue with shell and :session that I do not know how to deal with: In the following example when I do "C-c C-c" on #+BEGIN_SRC the result is as expected but on the "#+CALL" lines it should be : a:0 and : a:1 The :session is only to have more than one call which works for emacs-lisp source blocks. Am I doing something wrong or is this a bug? ------------------------------------------------------------ #+NAME: func #+HEADER: :var a=(or (org-entry-get org-babel-current-src-block-location "a" t) "0") #+BEGIN_SRC sh :shebang #!/bin/sh :results verbatim echo "a:$a" #+END_SRC #+RESULTS: func : a:0 #+CALL: func[:session default]() #+RESULTS: func[:session default]() : : > > ^[]0;^Gbash-3.2$ a:0 * section :PROPERTIES: :a: 1 :END: #+CALL: func[:session property]() #+RESULTS: func[:session property]() : : > > ^[]0;^Gbash-3.2$ a:1 ------------------------------------------------------------ Michael