branch: externals/org
commit 4b1154e32d17fbd69c5e70122c51c9397710ce86
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    lisp/org-element.el: Use consistent warning types for warnings
    
    (org-element--cache-log-message):
    (org-element--cache-warn): Use org-element warning type.
    (org-element-at-point): Assign warning type.
---
 lisp/org-element.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index a2989f0906..aba0fecd25 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -5865,7 +5865,7 @@ FORMAT-STRING and ARGS are the same arguments as in 
`foramt'."
                                    ,format-string))
             (format-string (funcall #'format format-string ,@args)))
        (if org-element--cache-diagnostics
-           (display-warning 'org-element-cache format-string)
+           (display-warning '(org-element 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)))
@@ -5890,7 +5890,7 @@ FORMAT-STRING and ARGS are the same arguments as in 
`format'."
                (setq org-element--cache-diagnostics-ring nil)))))
      (if (and (boundp 'org-batch-test) org-batch-test)
          (error "%s" (concat "org-element--cache: " format-string))
-       (display-warning 'org-element-cache
+       (display-warning '(org-element org-element-cache)
                         (concat "org-element--cache: " format-string)))))
 
 (defsubst org-element--cache-key (element)
@@ -8307,8 +8307,11 @@ This function may modify the match data."
     (setq epom (or epom (point)))
     (org-with-point-at epom
       (unless (derived-mode-p 'org-mode)
-        (warn "`org-element-at-point' cannot be used in non-Org buffer %S (%s)"
-              (current-buffer) major-mode))
+        (display-warning
+         '(org-element org-element-parser)
+         (format-message
+          "`org-element-at-point' cannot be used in non-Org buffer %S (%s)"
+          (current-buffer) major-mode)))
       ;; Allow re-parsing when the command can benefit from it.
       (when (and cached-only
                  (memq this-command org-element--cache-non-modifying-commands))

Reply via email to