emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org fac55324ac: org-element-at-point: Demote error to w


From: ELPA Syncer
Subject: [elpa] externals/org fac55324ac: org-element-at-point: Demote error to warning when called from non-Org buffer
Date: Sun, 5 Nov 2023 09:58:27 -0500 (EST)

branch: externals/org
commit fac55324accbcab08dfebbde8295b2f1b4b9f45e
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    org-element-at-point: Demote error to warning when called from non-Org 
buffer
    
    * lisp/org-element.el (org-element-at-point): Do not throw an error
    when `org-element-at-point' is called from non-Org buffer.  A number
    of third-party packages are incorrectly using `org-element-at-point'
    this way, relying upon `org-element-at-point' working in certain
    scenarios.  Throwing an error (as was done previously) made an urgent
    call to fix this problem, even when `org-element-at-point' happened to
    work in a particular scenario.  Now, we just display a warning to give
    package author more time to address or work around this.
    
    See https://github.com/alphapapa/org-web-tools/issues/61:
    
        @yantar92 I understand why this change was made, but perhaps it
        was a bit premature, given how much breakage it's causing
        downstream? It would seem appropriate to at least make it a
        warning for a full major version before making it an error, to
        give downstream devs and users a break.
---
 lisp/org-element.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 2ef4657ad3..ea469a8b37 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -8287,8 +8287,8 @@ This function may modify the match data."
     (setq epom (or epom (point)))
     (org-with-point-at epom
       (unless (derived-mode-p 'org-mode)
-        (error "`org-element-at-point' cannot be used in non-Org buffer %S 
(%s)"
-               (current-buffer) major-mode))
+        (warn "`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

[Prev in Thread] Current Thread [Next in Thread]