branch: externals/org
commit 717a847d649a9542714f56a90b22213786b2ee61
Author: Ihor Radchenko <yanta...@gmail.com>
Commit: Ihor Radchenko <yanta...@gmail.com>

    org-element-cache-map: Do not byte-compile FUNC in older Emacs
    
    * lisp/org-element.el (org-element-cache-map): Fix reported bug [1]
    when some agenda items are missing when `org-element-cache-map' is
    called from `org-agenda-get-scheduled'.  Byte compilation of FUNC
    matcher somehow fails to produce equivalent function in Emacs <28.
    
    [1] https://list.orgmode.org/87tuha62rq.fsf@localhost/T/#t
---
 lisp/org-element.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 7a8625a..a69f89c 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -7102,7 +7102,15 @@ of FUNC.  Changes to elements made in FUNC will also 
alter the cache."
                  continue-flag
                  ;; Byte-compile FUNC making sure that it is as performant
                  ;; as it could be.
-                 (func (if (or (byte-code-function-p func))
+                 (func (if (or (byte-code-function-p func)
+                               ;; FIXME: Working around bug
+                               ;; 
https://list.orgmode.org/87tuha62rq.fsf@localhost/T/#t
+                               ;; Byte-compilation in
+                               ;; `org-agenda-get-scheduled' call
+                               ;; somehow alters the FUNC result in
+                               ;; Emacs 26 and 27, but not in Emacs
+                               ;; >=28.
+                               (version< emacs-version "28"))
                            func
                          (let ((warning-minimum-log-level :error)
                                (inhibit-message t))

Reply via email to