org-element--parse-to: Get rid of unnecessary cache lookup

* lisp/org-element.el (org-element--parse-to): Disable cache in
`org-element--current-element'.  When calling it here, we know for
sure that element at point is not yet in cache.
This commit is contained in:
Ihor Radchenko 2021-12-24 12:30:09 +08:00
parent e0b1a05460
commit 8f50ea2d69
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 4 additions and 3 deletions

View File

@ -6421,9 +6421,10 @@ If you observe Emacs hangs frequently, please report this to Org mode mailing li
(unless (save-excursion
(org-skip-whitespace)
(eobp))
(setq element (org-element--current-element
end 'element mode
(org-element-property :structure parent))))
(org-element-with-disabled-cache
(setq element (org-element--current-element
end 'element mode
(org-element-property :structure parent)))))
;; Make sure that we return referenced element in cache
;; that can be altered directly.
(if element