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

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

[elpa] externals/org e8cb52bd3e 1/9: org-persist-read: Attempt to write


From: ELPA Syncer
Subject: [elpa] externals/org e8cb52bd3e 1/9: org-persist-read: Attempt to write newly register data before reading
Date: Thu, 29 Dec 2022 04:57:59 -0500 (EST)

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

    org-persist-read: Attempt to write newly register data before reading
    
    * lisp/org-persist.el (org-persist-read): If data is not yet written,
    try to write it before reading.
---
 lisp/org-persist.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index 3ef4eb24af..961a2b1ca2 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -828,14 +828,18 @@ When LOAD? is non-nil, load the data instead of reading."
              (plist-get collection :persist-file))))
          (data nil))
     (when (and collection
-               (file-exists-p persist-file)
                (or (not (plist-get collection :expiry)) ; current session
                    (not (org-persist--gc-expired-p
                        (plist-get collection :expiry) collection)))
                (or (not hash-must-match)
                    (and (plist-get associated :hash)
                         (equal (plist-get associated :hash)
-                               (plist-get (plist-get collection :associated) 
:hash)))))
+                               (plist-get (plist-get collection :associated) 
:hash))))
+               (or (file-exists-p persist-file)
+                   ;; Attempt to write data if it is not yet written.
+                   (progn
+                     (org-persist-write container associated 'no-read)
+                     (file-exists-p persist-file))))
       (unless (seq-find (lambda (v)
                           (run-hook-with-args-until-success 
'org-persist-before-read-hook v associated))
                         (plist-get collection :container))



reply via email to

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