Просмотр исходного кода

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.
Ihor Radchenko 3 лет назад
Родитель
Сommit
8f50ea2d69
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      lisp/org-element.el

+ 4 - 3
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