From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Two functions for efficient headline navigation Date: Mon, 22 Feb 2016 09:39:06 +0100 Message-ID: <87wppx16mt.fsf@nicolasgoaziou.fr> References: <56CA022F.7020002@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXlzQ-0001IF-6U for emacs-orgmode@gnu.org; Mon, 22 Feb 2016 03:37:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXlzN-0006dR-1B for emacs-orgmode@gnu.org; Mon, 22 Feb 2016 03:37:08 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:33920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXlzM-0006dN-Qo for emacs-orgmode@gnu.org; Mon, 22 Feb 2016 03:37:04 -0500 In-Reply-To: <56CA022F.7020002@gmail.com> (Christoph LANGE's message of "Sun, 21 Feb 2016 19:30:07 +0100") 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: Christoph LANGE Cc: "emacs-orgmode@gnu.org" Hello, Christoph LANGE 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