emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Two functions for efficient headline navigation
@ 2016-02-21 18:30 Christoph LANGE
  2016-02-22  8:39 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph LANGE @ 2016-02-21 18:30 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

Dear Org community,

at http://orgmode.org/worg/org-hacks.html#org-jump-to-child and
http://orgmode.org/worg/org-hacks.html#org-jump-to-id I have contributed
two interactive functions to aid structural navigation in large, complex
trees (source: http://orgmode.org/worg/code/elisp/org-jump.el).  The
latter function I had already introduced on this list on 2015-03-31.

Related to these functions I have a comment on Org's design.
org-jump-to-child (prompts for the title of a sub-heading of the current
heading and navigates there) was fairly complex to implement.  Coming
from an XML background I was surprised to see that Org has no notion of
a data model or of the semantics of a document and its tree, but that I
was basically required to implement an algorithm to walk through all
sub-headings and collect them.  Has an implementation based on a data
model ever been considered?  OTOH I could imagine it would not be easily
to implement this efficiently: as an Org document is technically a text
file that the user can edit without any restrictions, one would have to
continuously sync some internal data structure with the user's
text-level edits.

Cheers,

Christoph

-- 
Dr. Christoph Lange, Enterprise Information Systems Department
Applied Computer Science @ University of Bonn; Fraunhofer IAIS
http://langec.wordpress.com/about, Skype duke4701

→ Project management / coordination job in WDAqua Marie Curie ITN
  http://eis.iai.uni-bonn.de/Jobs.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Two functions for efficient headline navigation
  2016-02-21 18:30 Two functions for efficient headline navigation Christoph LANGE
@ 2016-02-22  8:39 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2016-02-22  8:39 UTC (permalink / raw)
  To: Christoph LANGE; +Cc: emacs-orgmode@gnu.org

Hello,

Christoph LANGE <math.semantic.web@gmail.com> writes:

> Related to these functions I have a comment on Org's design.
> org-jump-to-child (prompts for the title of a sub-heading of the current
> heading and navigates there) was fairly complex to implement.  Coming
> from an XML background I was surprised to see that Org has no notion of
> a data model or of the semantics of a document and its tree, but that I
> was basically required to implement an algorithm to walk through all
> sub-headings and collect them.  Has an implementation based on a data
> model ever been considered?

See

  (org-with-wide-buffer
   (org-narrow-to-subtree)
   (org-element-parse-buffer 'headline))

and

  `org-element-map'

Also, `org-map-entries' could do the job, with a `tree' SCOPE and an
appropriate MATCH (e.g. "LEVEL>N" where N is the current level).

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-22  8:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-21 18:30 Two functions for efficient headline navigation Christoph LANGE
2016-02-22  8:39 ` Nicolas Goaziou

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).