forked from mirrors/org-mode
fixup! org-element--cache-for-removal: Fix changing heading granularity
* lisp/org-element.el: (org-element--cache-for-removal): Explicitly assign :granularity to not deceive parser when parsing for different granularity than cache. Cache is always using 'element granularity. This commit is only needed on bugfix. On main, :granularity is set correctly.
This commit is contained in:
parent
07f099f84e
commit
453c47b57d
|
@ -6567,7 +6567,9 @@ If you observe Emacs hangs frequently, please report this to Org mode mailing li
|
||||||
;; Make sure that we return referenced element in cache
|
;; Make sure that we return referenced element in cache
|
||||||
;; that can be altered directly.
|
;; that can be altered directly.
|
||||||
(if element
|
(if element
|
||||||
(setq element (or (org-element--cache-put element) element))
|
(progn
|
||||||
|
(org-element-put-property element :granularity 'element)
|
||||||
|
(setq element (or (org-element--cache-put element) element)))
|
||||||
;; Nothing to parse (i.e. empty file).
|
;; Nothing to parse (i.e. empty file).
|
||||||
(throw 'exit parent))
|
(throw 'exit parent))
|
||||||
(unless (or (not (org-element--cache-active-p)) parent)
|
(unless (or (not (org-element--cache-active-p)) parent)
|
||||||
|
@ -6948,6 +6950,7 @@ known element in cache (it may start after END)."
|
||||||
"Found non-robust headline that can be updated individually: %S"
|
"Found non-robust headline that can be updated individually: %S"
|
||||||
(org-element--format-element current))
|
(org-element--format-element current))
|
||||||
(org-element-set-element up current)
|
(org-element-set-element up current)
|
||||||
|
(org-element-put-property up :granularity 'element)
|
||||||
t)))
|
t)))
|
||||||
;; If UP is org-data, the situation is similar to
|
;; If UP is org-data, the situation is similar to
|
||||||
;; headline case. We just need to re-parse the
|
;; headline case. We just need to re-parse the
|
||||||
|
|
Loading…
Reference in a new issue