org-element: Small optimization
* lisp/org-element.el (org-element-at-point): Do not call `outline-next-heading' when an element at top level contains point. This is particularly important when the current section ends way after the point.
This commit is contained in:
parent
cd3bc12a29
commit
fd877a7380
|
@ -4800,8 +4800,7 @@ element ending there."
|
||||||
((eobp) (setq element up))
|
((eobp) (setq element up))
|
||||||
(t (setq element up next (point))))))))
|
(t (setq element up next (point))))))))
|
||||||
;; Parse successively each element until we reach ORIGIN.
|
;; Parse successively each element until we reach ORIGIN.
|
||||||
(let ((end (or (org-element-property
|
(let ((end (or (org-element-property :end element)
|
||||||
:contents-end (org-element-property :parent element))
|
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(org-with-limited-levels (outline-next-heading))
|
(org-with-limited-levels (outline-next-heading))
|
||||||
(point))))
|
(point))))
|
||||||
|
|
Loading…
Reference in New Issue