From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Wales Subject: Re: Org-mode outside Org-mode Date: Sat, 13 Apr 2013 13:48:56 -0700 Message-ID: References: <87txoc7jvr.fsf@gmail.com> <874nfm9ylq.fsf@gmail.com> <87txnl486a.fsf@gmail.com> <87fvz3f8uh.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UR7Nc-00055y-I6 for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 16:49:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UR7NZ-0003YM-As for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 16:49:00 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:36887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UR7NZ-0003YG-4Q for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 16:48:57 -0400 Received: by mail-wg0-f43.google.com with SMTP id f12so3640027wgh.10 for ; Sat, 13 Apr 2013 13:48:56 -0700 (PDT) In-Reply-To: <87fvz3f8uh.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: emacs-orgmode@gnu.org, Thorsten Jolitz Hi Eric, Here is old not-working not-finished code that I abandoned. But it illustrates the goal. Samuel === Maybe something like: - In source file, C-c ' to go to Org entry associated with nearest ID marker - C-u C-c ' to create ID marker and create its Org entry in your Org file - when it is created, you can refile it wherever - C-c ' in Org entry to go to associated source file ID marker ;; this is quick and dirty code ;; ;; it is brittle to store a file path. it is much better to ;; incorporate ID markers into the Org ID system, then Org will ;; find the file using org-id-goto. to tell the system where you ;; keep your source files, set a variable. ;; ;; doing so will eliminate the need to store a pathname property. ;; ;; maybe this can be refactored with detangling markers. ;; ;; see also annotation, which requires no marker, but is more ;; brittle and does not indicate that you have an annotation. ;; this should be merged with that. (defconst alpha-org-id-pair-file-property "ID-pair-file") (defun alpha-org-bounce-id-pair () "The opposite of Org Babel. C-c ' in source code to document it in Org. Same in documentation to go to source code." (interactive) (let ((id (org-id-get))) (if id (org-id-goto id) (let ((source (org-entry-get nil alpha-org-id-pair-file-property))) (find-file source) (re-search-forward id) (forward-line 1))))) (defun* alpha-org-bounce-or-insert-id-pair (&key (comment ";; ")) "Bounce to the other end of, or create, a (notes, ID marker) pair. Suppose you are editing an Emacs Lisp source code file. You can bounce between a special entry in your Org agenda file \(e.g. notes.org\) and your external file \(e.g. file.el\)." (interactive) (let ((id (org-id-new "id-pair"))) (save-excursion (alpha-org-insert-id-marker id :comment comment)) (org-capture nil))) (defun* alpha-org-insert-id-marker (id &key comment) "Insert an ID marker." (insert (concat (when comment comment) "$[id " id ;; (when link (concat " :link " link)) ;; ;; (org-insert-link) ;; (when label (concat " :label \"" label "\"")) "]")) (forward-line -1) (funcall indent-line-function)) On 4/6/13, Eric Schulte wrote: > 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. -- 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.