From 8f50ea2d69b046be8459aaf8176349adf9b1ef17 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Fri, 24 Dec 2021 12:30:09 +0800 Subject: [PATCH] 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. --- lisp/org-element.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index a617c58f8..be48bf500 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -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