forked from mirrors/org-mode
Merge branch 'master' of orgmode.org:org-mode
This commit is contained in:
commit
6bc020f153
|
@ -5011,22 +5011,25 @@ the cache."
|
||||||
"Store ELEMENT in current buffer's cache, if allowed.
|
"Store ELEMENT in current buffer's cache, if allowed.
|
||||||
When optional argument DATA is non-nil, assume is it object data
|
When optional argument DATA is non-nil, assume is it object data
|
||||||
relative to ELEMENT and store it in the objects cache."
|
relative to ELEMENT and store it in the objects cache."
|
||||||
(when (org-element--cache-active-p)
|
(cond ((not (org-element--cache-active-p)) nil)
|
||||||
(if data (puthash element data org-element--cache-objects)
|
((not data)
|
||||||
(when org-element--cache-sync-requests
|
(when org-element--cache-sync-requests
|
||||||
;; During synchronization, first build an appropriate key for
|
;; During synchronization, first build an appropriate key
|
||||||
;; the new element so `avl-tree-enter' can insert it at the
|
;; for the new element so `avl-tree-enter' can insert it at
|
||||||
;; right spot in the cache.
|
;; the right spot in the cache.
|
||||||
(let ((keys (org-element--cache-find
|
(let ((keys (org-element--cache-find
|
||||||
(org-element-property :begin element) 'both)))
|
(org-element-property :begin element) 'both)))
|
||||||
(puthash element
|
(puthash element
|
||||||
(org-element--cache-generate-key
|
(org-element--cache-generate-key
|
||||||
(and (car keys) (org-element--cache-key (car keys)))
|
(and (car keys) (org-element--cache-key (car keys)))
|
||||||
(cond ((cdr keys) (org-element--cache-key (cdr keys)))
|
(cond ((cdr keys) (org-element--cache-key (cdr keys)))
|
||||||
(org-element--cache-sync-requests
|
(org-element--cache-sync-requests
|
||||||
(aref (car org-element--cache-sync-requests) 0))))
|
(aref (car org-element--cache-sync-requests) 0))))
|
||||||
org-element--cache-sync-keys)))
|
org-element--cache-sync-keys))))
|
||||||
(avl-tree-enter org-element--cache element))))
|
;; Headlines are not stored in cache, so objects in titles are
|
||||||
|
;; not stored either.
|
||||||
|
((eq (org-element-type element) 'headline) nil)
|
||||||
|
(t (puthash element data org-element--cache-objects))))
|
||||||
|
|
||||||
|
|
||||||
;;;; Synchronization
|
;;;; Synchronization
|
||||||
|
|
Loading…
Reference in New Issue