[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] org-element - canonical way to parse only headline at point?
From: |
Thorsten Jolitz |
Subject: |
Re: [O] org-element - canonical way to parse only headline at point? |
Date: |
Wed, 30 Jul 2014 19:23:16 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Nicolas Goaziou <address@hidden> writes:
> Hello,
>
> Thorsten Jolitz <address@hidden> 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