emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] org-element - canonical way to parse only headline at point?


From: Thorsten Jolitz
Subject: [O] org-element - canonical way to parse only headline at point?
Date: Tue, 29 Jul 2014 19:33:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Hi List,

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

-- 
cheers,
Thorsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]