From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: org-element - canonical way to parse only headline at point? Date: Wed, 30 Jul 2014 19:23:16 +0200 Message-ID: <87k36uahh7.fsf@gmail.com> References: <87tx60oyrz.fsf@gmail.com> <87iomestmv.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCXbE-0002hs-I2 for emacs-orgmode@gnu.org; Wed, 30 Jul 2014 13:23:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCXb8-0004RX-2z for emacs-orgmode@gnu.org; Wed, 30 Jul 2014 13:23:36 -0400 Received: from plane.gmane.org ([80.91.229.3]:40091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCXb7-0004RQ-RT for emacs-orgmode@gnu.org; Wed, 30 Jul 2014 13:23:29 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XCXb6-0001tj-0f for emacs-orgmode@gnu.org; Wed, 30 Jul 2014 19:23:28 +0200 Received: from e178189071.adsl.alicedsl.de ([85.178.189.71]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Jul 2014 19:23:28 +0200 Received: from tjolitz by e178189071.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Jul 2014 19:23:28 +0200 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: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > Thorsten Jolitz writes: > >> with the new parser, how do I parse only the headline at point? There >> are ARGS in the parser/mapper functions that restrict parsing, but I >> suspect that still the whole buffer is parsed for the genealogy - right? >> >> With my current knowledge I would either narrow the buffer to the subtree at >> point or copy this subtree to a temp-buffer before parsing/mapping it, >> but maybe there is a better way? >> >> Would this be a valid template (a simple and fast solution)? >> >> #+begin_src emacs-lisp >> (save-restriction >> (org-narrow-to-subtree >> (org-element-map (org-element-parse-buffer 'headline t) 'headline >> (lambda () ...) >> nil t t))) >> #+end_src > > What about (org-element-at-point) ? Thats why I asked - exactly the function I was looking for. Thanks. -- cheers, Thorsten