branch: externals/org
commit 3ec093312201b5ee02e77cdaff166d3c55d5155f
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    Fix Emacs 27 test failure
    
    * lisp/org-id.el (org-id-find-id-in-file): Work around change
    functions not always firing up in Emacs 27 when using
    `insert-file-contents'.
---
 lisp/org-id.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/org-id.el b/lisp/org-id.el
index c11fa9a2d1..463bd831cb 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -686,8 +686,12 @@ optional argument MARKERP, return the position as a new 
marker."
             (unless (derived-mode-p 'org-mode) (org-mode))
             (unless (or visiting markerp)
               (buffer-disable-undo)
-              (erase-buffer)
-              (insert-file-contents file))
+              ;; FIXME: In Emacs 27, `insert-file-contents' seemingly
+              ;; does not trigger modification hooks in some
+              ;; scenarios.  This is manifested in test failures due
+              ;; to element cache losing track of the modifications.
+              (org-element-cache-reset)
+              (insert-file-contents file nil nil nil 'replace))
            (let ((pos (org-find-entry-with-id id)))
              (cond
               ((null pos) nil)

Reply via email to