emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Org-mode outside Org-mode


From: Samuel Wales
Subject: Re: [O] Org-mode outside Org-mode
Date: Thu, 11 Apr 2013 18:04:37 -0700

On 4/6/13, Eric Schulte <address@hidden> wrote:
>>> The idea is to be in my-lisp.el, and do C-c ', and get to a canonical
>>> entry in my-org.org, then do C-c ' again and get back to my-lisp.el.

> That could be handy.  For jumping back and for by function name, the
> following simple implementation might be sufficient.  It relies on file
> local variables to know which src and Org-mode files are related to each
> other.

Interesting implementation, thanks for coding it.

I was thinking about Org ID instead of local variables.

In the Org file, you have an entry with an Org ID and a property with
the source file location.

In the source file, you have a marker in a comment like this:

  ;; $[id 12345]

Where 12345 is an automatically-generated Org ID in the typical unique format.

The job of C-c ' in the source file is to search for the nearest ID
marker, then go to the entry that has that ID in the Org file.  The
job of C-c ' in the Org file is to get the Org ID, then search for the
marker that contains it in the source file.

Then the Org ID mechanism finds the Org file without requiring local variables.

(Or, of course, for read-only files, a bookmark-like mechanism can be
used to keep a database of search strings, indexed by the ID, to find
the location.  This means no need for Org ID in the source file and no
need for local variables.  But the ID method is more robust.)

Samuel

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

The disease DOES progress.  MANY people have died from it.  ANYBODY
can get it.  There is NO hope without action.  This means YOU.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]