lisp/org-persist.el: Ignore lock files when writing cache
* lisp/org-persist.el (org-persist--write-elisp-file): Ignore locks. Reported-by: Greg Minshall <minshall@umich.edu> Link: https://orgmode.org/list/574109.1715751441@archlinux
This commit is contained in:
parent
64bb80b982
commit
dc485a6590
|
@ -476,12 +476,17 @@ FORMAT and ARGS are passed to `message'."
|
||||||
(start-time (float-time)))
|
(start-time (float-time)))
|
||||||
(unless (file-exists-p (file-name-directory file))
|
(unless (file-exists-p (file-name-directory file))
|
||||||
(make-directory (file-name-directory file) t))
|
(make-directory (file-name-directory file) t))
|
||||||
(with-temp-file file
|
;; Force writing even when the file happens to be opened by
|
||||||
(insert ";; -*- mode: lisp-data; -*-\n")
|
;; another Emacs process.
|
||||||
(if pp
|
(cl-letf (((symbol-function #'ask-user-about-lock)
|
||||||
(let ((pp-use-max-width nil)) ; Emacs bug#58687
|
;; FIXME: Emacs 27 does not yet have `always'.
|
||||||
(pp data (current-buffer)))
|
(lambda (&rest _) t)))
|
||||||
(prin1 data (current-buffer))))
|
(with-temp-file file
|
||||||
|
(insert ";; -*- mode: lisp-data; -*-\n")
|
||||||
|
(if pp
|
||||||
|
(let ((pp-use-max-width nil)) ; Emacs bug#58687
|
||||||
|
(pp data (current-buffer)))
|
||||||
|
(prin1 data (current-buffer)))))
|
||||||
(org-persist--display-time
|
(org-persist--display-time
|
||||||
(- (float-time) start-time)
|
(- (float-time) start-time)
|
||||||
"Writing to %S" file)))
|
"Writing to %S" file)))
|
||||||
|
|
Loading…
Reference in New Issue