mb...@mbork.pl writes:

> with the point on a headline, I'd like to be able to get the positions
> of the start and end of the current headline's title.  How to do that?
> Here's what I have, is there a better way?
>
> (This includes tags; I'm fine with that, though excluding them might be
> better.)
>
> --8<---------------cut here---------------start------------->8---
> (let* ((elt (org-element-at-point))
>        (begin (save-excursion
>                 (goto-char (org-element-property :begin elt))
>                 (when (looking-at org-element-headline-re)
>                   (match-end 0))))
>        (end (1- (org-element-property :contents-begin elt))))
>      ...)

Try `org-complex-heading-regexp'.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to