emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org, Thorsten Jolitz <tjolitz@gmail.com>
Subject: Re: Org-mode outside Org-mode
Date: Thu, 11 Apr 2013 18:04:37 -0700	[thread overview]
Message-ID: <CAJcAo8vXAYpX1VWanT-TGFUn4oOgALxPcyabgWbysfgkdR0ffQ@mail.gmail.com> (raw)
In-Reply-To: <87fvz3f8uh.fsf@gmail.com>

On 4/6/13, Eric Schulte <schulte.eric@gmail.com> 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.

  parent reply	other threads:[~2013-04-12  1:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15 15:39 Org-mode outside Org-mode Thorsten Jolitz
2013-03-15 16:47 ` Thomas S. Dye
2013-04-03 18:23 ` Samuel Wales
2013-04-04 14:09   ` Thorsten Jolitz
2013-04-04 20:17     ` Samuel Wales
2013-04-05  9:51       ` Thorsten Jolitz
2013-04-07  1:05         ` Eric Schulte
2013-04-07  7:49           ` Bastien
2013-04-12  1:04           ` Samuel Wales [this message]
2013-04-13 20:48           ` Samuel Wales
2013-04-12  1:19         ` Samuel Wales
2013-04-12 10:44           ` Thorsten Jolitz
2013-04-13 20:45             ` Samuel Wales
2013-04-27  8:35               ` Thorsten Jolitz
2013-04-24 14:20 ` Alexander Vorobiev
2013-04-24 18:39   ` Thorsten Jolitz
2013-04-25 17:33   ` Thorsten Jolitz

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=CAJcAo8vXAYpX1VWanT-TGFUn4oOgALxPcyabgWbysfgkdR0ffQ@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.com \
    --cc=tjolitz@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).