emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Michael Brand <michael.ch.brand@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: link abbreviation with multiple params, e. g. for geo locations
Date: Thu, 06 Jun 2013 11:01:38 -0600	[thread overview]
Message-ID: <87a9n35g25.fsf@gmail.com> (raw)
In-Reply-To: <CALn3zogSUmgFNr1DrUsjwJ19x_0ODP6rYLNB37m1-Jxai-B6Wg@mail.gmail.com> (Michael Brand's message of "Wed, 22 May 2013 19:03:09 +0200")

[-- Attachment #1: Type: text/plain, Size: 1586 bytes --]

Michael Brand <michael.ch.brand@gmail.com> writes:

> Hi all
>
> On Tue, May 7, 2013 at 12:29 AM, Christian Moe <mail@christianmoe.com> 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.
>

Please forgive my lateness to this thread.  Is the only requirement that
the point from which a code block was called be accessible to the
emacs-lisp code executed within that code block?

If so then there should be no need for additional development.  The
following already works thanks to some very recently applied changes.
See the attached example which demonstrates how to access the point of
the original call from a code block.

Cheers,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-entry-get-point-example.org --]
[-- Type: text/x-org, Size: 798 bytes --]

#+Options: ^:{}

* Org babel function for Google Maps browser

Here I simplify the previous Google maps function to simply
demonstrate the recovery of entry properties.

#+NAME: gmb
#+HEADER: :var geo_var=(or (org-entry-get org-babel-current-exec-src-block-head "geo") "4.56,7.89")
#+BEGIN_SRC emacs-lisp :results silent
  (format "geo_var is %s" geo_var)
#+END_SRC

* example of a geo location, realistic to try out
  :PROPERTIES:
  :geo:      4.56,7.89
  :END:

- call_gmb() =geo_var is 4.56,7.89=
  - interactively (type C-c on "call_gmb") visualize the current geo
    location on Google Maps with a marker and as "map" in the
    browser

* another geo location
  :PROPERTIES:
  :geo:      4.44,5.55
  :END:

- call_gmb() =geo_var is 4.44,5.55=
  - visualize another geo location as "terrain"

[-- Attachment #3: Type: text/plain, Size: 46 bytes --]


-- 
Eric Schulte
http://cs.unm.edu/~eschulte

  parent reply	other threads:[~2013-06-06 17:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 17:03 link abbreviation with multiple params, e. g. for geo locations Michael Brand
2013-05-29 16:14 ` Michael Brand
2013-06-05 17:19   ` Michael Brand
2013-06-06 17:01 ` Eric Schulte [this message]
2013-06-07 14:53   ` Michael Brand
2013-06-07 15:18     ` Eric Schulte
2013-06-07 19:16       ` Michael Brand
2013-06-07 19:54         ` Vitalie Spinu
2013-06-08 18:05           ` Eric Schulte
2013-06-08 18:52             ` Vitalie Spinu
2013-06-08 19:21               ` Eric Schulte
2013-06-14 17:54                 ` Michael Brand
2013-06-14 18:18                   ` Eric Schulte
2013-06-14 20:13                     ` Michael Brand
2013-06-19  9:39                       ` Michael Brand
2013-06-07 20:10         ` Achim Gratz
2013-06-08 18:03         ` Eric Schulte
2013-06-09  7:56           ` Michael Brand
2013-06-09  8:07             ` Michael Brand
2013-06-09 19:18             ` Eric Schulte
2013-06-09 20:32               ` Michael Brand
2013-06-11 13:12                 ` Eric Schulte
  -- strict thread matches above, loose matches on Subject: below --
2013-05-05 15:06 Michael Brand
2013-05-06  7:06 ` Christian Moe
2013-05-06 18:42   ` Michael Brand
2013-05-06 22:29     ` Christian Moe

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=87a9n35g25.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=michael.ch.brand@gmail.com \
    /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).