[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release
From: |
Ihor Radchenko |
Subject: |
Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)] |
Date: |
Sun, 29 Dec 2024 07:13:01 +0000 |
Paul Stansell <paulstansell@gmail.com> writes:
>> This looks more reasonable.
>> Is this with my patch applied?
>>
>
> Yes, the patch is applied.
Ok. Then, may you try another version of the patch?
>From 13ade2328dcae881296b5d7acc4493022a8895f3 Mon Sep 17 00:00:00 2001
Message-ID:
<13ade2328dcae881296b5d7acc4493022a8895f3.1735456333.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Tue, 24 Dec 2024 09:45:42 +0100
Subject: [PATCH v2] org-persist: Fix mixing cace data from multiple Emacs
processes
* lisp/org-persist.el (org-persist--write-elisp-file): When there is a
clash with other Emacs process while writing cache data, discard the
cache to avoid any problem.
(org-persist--refresh-gc-lock):
(org-persist--gc-orphan-p): Bail out when writing fails.
Reported-by: Paul Stansell <paulstansell@gmail.com>
Link:
https://orgmode.org/list/YT3PR01MB95943D4DB2E659091A2BDE8DBE2E2@YT3PR01MB9594.CANPRD01.PROD.OUTLOOK.COM
---
lisp/org-persist.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index 4ff43ad7a5..d2ceb8f90f 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -478,11 +478,12 @@ (defun org-persist--write-elisp-file (file data &optional
no-circular pp)
(start-time (float-time)))
(unless (file-exists-p (file-name-directory file))
(make-directory (file-name-directory file) t))
- ;; Force writing even when the file happens to be opened by
- ;; another Emacs process.
+ ;; Discard cache when there is a clash with other Emacs process.
+ ;; This way, we make sure that cache is never mixing data & record
+ ;; from different processes.
(cl-letf (((symbol-function #'ask-user-about-lock)
- ;; FIXME: Emacs 27 does not yet have `always'.
- (lambda (&rest _) t)))
+ (lambda (&rest _)
+ (error "Other Emacs process is writing to cache"))))
(with-temp-file file
(insert ";; -*- mode: lisp-data; -*-\n")
(if pp
@@ -1251,7 +1252,7 @@ (defun org-persist--refresh-gc-lock ()
(when (< (- (float-time (cdr record)) (float-time (current-time)))
org-persist-gc-lock-expiry)
(push record new-alist)))
- (org-persist--write-elisp-file file new-alist)))
+ (ignore-errors (org-persist--write-elisp-file file new-alist))))
(defun org-persist--gc-orphan-p ()
"Return non-nil, when orphan files should be garbage-collected.
@@ -1259,7 +1260,7 @@ (defun org-persist--gc-orphan-p ()
(let* ((file (org-file-name-concat org-persist-directory
org-persist-gc-lock-file))
(alist (when (file-exists-p file) (org-persist--read-elisp-file
file))))
(setq alist (org-assoc-delete-all before-init-time alist))
- (org-persist--write-elisp-file file alist)
+ (ignore-errors (org-persist--write-elisp-file file alist))
;; Only GC orphan files when there are no active sessions.
(not alist)))
--
2.47.1
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], (continued)
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Ihor Radchenko, 2024/12/23
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Paul Stansell, 2024/12/23
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Ihor Radchenko, 2024/12/24
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Paul Stansell, 2024/12/27
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Ihor Radchenko, 2024/12/27
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Paul Stansell, 2024/12/27
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Paul Stansell, 2024/12/27
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Ihor Radchenko, 2024/12/27
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Paul Stansell, 2024/12/27
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Paul Stansell, 2024/12/28
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)],
Ihor Radchenko <=
- Re: [BUG] "Invalid search bound (wrong side of point)" [9.8-pre (release_9.7.16-169-ge87ecf @ ~/.emacs.d/org-mode-git/lisp/)], Paul Stansell, 2024/12/29