[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 85b5f4e 04/13: Modified cache to only work for specific fi
From: |
Ian Dunn |
Subject: |
[elpa] master 85b5f4e 04/13: Modified cache to only work for specific finders |
Date: |
Sun, 25 Nov 2018 14:09:47 -0500 (EST) |
branch: master
commit 85b5f4e1ed1c5cb75e3c67c3b9e204cc22b1b906
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
Modified cache to only work for specific finders
* org-edna.el (org-edna-finder-cache-enabled-finders): List of finder
functions
for which cache is enabled.
(org-edna--cache-is-enabled-for-finder): New function.
(org-edna--handle-finder): Use it.
---
org-edna.el | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/org-edna.el b/org-edna.el
index ee10b17..dcb3157 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -505,6 +505,24 @@ adding unrelated headlines, will be taken into account."
:group 'org-edna
:type 'number)
+(defvar org-edna-finder-cache-enabled-finders
+ '(org-edna-finder/match
+ org-edna-finder/ids
+ org-edna-finder/olp
+ org-edna-finder/file
+ org-edna-finder/org-file)
+ "List of finders for which cache is enabled.
+
+Only edit this list if you've added custom finders. Many
+finders, specifically relative finders, rely on the context in
+which they're called. For these finders, cache will not work
+properly.
+
+The default state of this list contains the built-in finders for
+which context is irrelevant.
+
+Each entry is the function symbol for the finder.")
+
(defun org-edna--add-to-finder-cache (func-sym args)
(let* ((results (apply func-sym args))
(input (make-org-edna--finder-input :func-sym func-sym
@@ -548,8 +566,12 @@ following reasons:
;; We have an entry created within the allowed interval.
(t entry))))
+(defun org-edna--cache-is-enabled-for-finder (func-sym)
+ (memq func-sym org-edna-finder-cache-enabled-finders))
+
(defun org-edna--handle-finder (func-sym args)
- (if (not org-edna-finder-use-cache)
+ (if (or (not org-edna-finder-use-cache)
+ (not (org-edna--cache-is-enabled-for-finder func-sym)))
;; Not using cache, so use the function directly.
(apply func-sym args)
(let* ((entry (org-edna--get-cache-entry func-sym args)))
- [elpa] master updated (7cacd8a -> 76ef9bf), Ian Dunn, 2018/11/25
- [elpa] master a7286e6 03/13: Mention consider in opening of Consideration section, Ian Dunn, 2018/11/25
- [elpa] master 85b5f4e 04/13: Modified cache to only work for specific finders,
Ian Dunn <=
- [elpa] master 9dea42d 02/13: Added note about naming conventions., Ian Dunn, 2018/11/25
- [elpa] master 0194996 01/13: Added org-edna-describe-keyword function, Ian Dunn, 2018/11/25
- [elpa] master 1bb1fed 08/13: Added timestamp sorting to relatives finder, Ian Dunn, 2018/11/25
- [elpa] master 2c5ac0c 12/13: Bumped version, Ian Dunn, 2018/11/25
- [elpa] master 58be309 06/13: Fixed up description of set-effort!., Ian Dunn, 2018/11/25
- [elpa] master c6b3234 07/13: Additional tests and minor cleanup, Ian Dunn, 2018/11/25
- [elpa] master cb98c0f 10/13: Removed remnants of old build system, Ian Dunn, 2018/11/25
- [elpa] master 98651a0 09/13: Inverted definition of consideration, Ian Dunn, 2018/11/25
- [elpa] master 45310da 05/13: Various fixes from testing, Ian Dunn, 2018/11/25
- [elpa] master 26d2a0d 11/13: Added has-tags? and matches? conditions, Ian Dunn, 2018/11/25