[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 19a383d9f4 29/31: org-persist-write-all: Speed up w
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 19a383d9f4 29/31: org-persist-write-all: Speed up writing |
Date: |
Sat, 29 Jan 2022 04:58:15 -0500 (EST) |
branch: externals/org
commit 19a383d9f4bf3bd893542c757e2fed6ec1ff4cac
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
org-persist-write-all: Speed up writing
* lisp/org-persist.el (org-persist-write): New optional argument
bypassing extra `org-persist-read' invocation.
(org-persist-write-all): Call faster version of `org-persist-write'.
---
lisp/org-persist.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lisp/org-persist.el b/lisp/org-persist.el
index 2c6cec4e42..fcc4d82d55 100644
--- a/lisp/org-persist.el
+++ b/lisp/org-persist.el
@@ -800,13 +800,15 @@ The arguments have the same meaning as in
`org-persist-read'."
"Call `org-persist-load-all' in current buffer."
(org-persist-load-all (current-buffer)))
-(defun org-persist-write (container &optional associated)
+(defun org-persist-write (container &optional associated ignore-return)
"Save CONTAINER according to ASSOCIATED.
ASSOCIATED can be a plist, a buffer, or a string.
A buffer is treated as (:buffer ASSOCIATED).
A string is treated as (:file ASSOCIATED).
The return value is nil when writing fails and the written value (as
-returned by `org-persist-read') on success."
+returned by `org-persist-read') on success.
+When IGNORE-RETURN is non-nil, just return t on success without calling
+`org-persist-read'."
(setq associated (org-persist--normalize-associated associated))
;; Update hash
(when (and (plist-get associated :file)
@@ -823,7 +825,7 @@ returned by `org-persist-read') on success."
(data (mapcar (lambda (c) (cons c (org-persist-write:generic c
collection)))
(plist-get collection :container))))
(org-persist--write-elisp-file file data)
- (org-persist-read container associated))))))
+ (or ignore-return (org-persist-read container associated)))))))
(defun org-persist-write-all (&optional associated)
"Save all the persistent data.
@@ -835,10 +837,10 @@ When ASSOCIATED is non-nil, only save the matching data."
(if associated
(when collection
(cl-pushnew (plist-get collection :container) all-containers :test
#'equal))
- (org-persist-write (plist-get collection :container) (plist-get
collection :associated))))
+ (org-persist-write (plist-get collection :container) (plist-get
collection :associated) t)))
(dolist (container all-containers)
(when (org-persist--find-index `(:container ,container :associated
,associated))
- (org-persist-write container associated)))))
+ (org-persist-write container associated t)))))
(defun org-persist-write-all-buffer ()
"Call `org-persist-write-all' in current buffer.
- [elpa] externals/org 7c2d93560c 03/31: org-persist-default-expiry: Introduce and change default, (continued)
- [elpa] externals/org 7c2d93560c 03/31: org-persist-default-expiry: Introduce and change default, ELPA Syncer, 2022/01/29
- [elpa] externals/org 1084566322 08/31: Fix org-persist-unregister, ELPA Syncer, 2022/01/29
- [elpa] externals/org d5fc159bf7 15/31: Fix compiler warnings, ELPA Syncer, 2022/01/29
- [elpa] externals/org 203420504e 11/31: org-persist-load:elisp: fix loading, ELPA Syncer, 2022/01/29
- [elpa] externals/org fca80139ee 18/31: org-persist: Fix compatibility with Emacs 27, ELPA Syncer, 2022/01/29
- [elpa] externals/org dc52c0fe99 17/31: Fix native-comp warnings, ELPA Syncer, 2022/01/29
- [elpa] externals/org f3bd1dcb77 20/31: org-persist: Fix compiler warnings, ELPA Syncer, 2022/01/29
- [elpa] externals/org 1bc8389871 21/31: org-persist-read: Check expiry, ELPA Syncer, 2022/01/29
- [elpa] externals/org 6b175fb227 27/31: org-persist-register: Make return value meaningful with :write-immidiately, ELPA Syncer, 2022/01/29
- [elpa] externals/org f0e0716f54 28/31: org-element: Use new cache container format, ELPA Syncer, 2022/01/29
- [elpa] externals/org 19a383d9f4 29/31: org-persist-write-all: Speed up writing,
ELPA Syncer <=
- [elpa] externals/org ac5742f296 31/31: Merge branch 'feature/org-persist-new-tidy', ELPA Syncer, 2022/01/29
- [elpa] externals/org 38a681fdae 05/31: org-element-cache-reset: Do not persist caches for non-file buffers, ELPA Syncer, 2022/01/29
- [elpa] externals/org 8821ff5811 09/31: org-persist-read: Do not try to read non-existing containers, ELPA Syncer, 2022/01/29
- [elpa] externals/org 4ec57a9453 16/31: org-persist: Update commentary, ELPA Syncer, 2022/01/29
- [elpa] externals/org ec787fb218 19/31: org-persist: Implement "file" and "url" containers linked to other file, ELPA Syncer, 2022/01/29
- [elpa] externals/org 6a5874bb26 25/31: org-persist-write: Overwrite existing copy if write is requested, ELPA Syncer, 2022/01/29
- [elpa] externals/org 0e18c617cf 24/31: org-persist-write:index: Return index path on write, ELPA Syncer, 2022/01/29
- [elpa] externals/org eca678195b 23/31: org-persist-write: Return the written value on success, ELPA Syncer, 2022/01/29
- [elpa] externals/org 0526acd16f 22/31: org-persist-register: New optional keyword to force immidiate write, ELPA Syncer, 2022/01/29
- [elpa] externals/org caccec2c54 26/31: org-persist: Use symbols as container names, ELPA Syncer, 2022/01/29