org-element-cache: Use 'org-element-cache warning type

* lisp/org-element.el (org-element--cache-log-message):
(org-element--cache-warn): Use special 'org-element-cache warning
type to display warnings.
This commit is contained in:
Ihor Radchenko 2021-11-24 15:45:29 +08:00
parent 77a9932b03
commit cc3b468657
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 3 additions and 2 deletions

View File

@ -5461,7 +5461,7 @@ better to remove the commands adviced in such way from this list.")
,format-string))
(format-string (funcall #'format format-string ,@args)))
(if org-element--cache-diagnostics
(warn "%s" format-string)
(display-warning 'org-element-cache format-string)
(unless org-element--cache-diagnostics-ring
(setq org-element--cache-diagnostics-ring
(make-ring org-element--cache-diagnostics-ring-size)))
@ -5485,7 +5485,8 @@ better to remove the commands adviced in such way from this list.")
(setq org-element--cache-diagnostics-ring nil)))))
(if (and (boundp 'org-batch-test) org-batch-test)
(error "%s" (concat "org-element--cache: " format-string))
(warn "%s" (concat "org-element--cache: " format-string)))))
(display-warning 'org-element-cache
(concat "org-element--cache: " format-string)))))
(defsubst org-element--cache-key (element)
"Return a unique key for ELEMENT in cache tree.