[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 972968a 116/135: Modified cache to only work for specific
From: |
Ian Dunn |
Subject: |
[elpa] master 972968a 116/135: Modified cache to only work for specific finders |
Date: |
Mon, 17 Feb 2020 10:53:03 -0500 (EST) |
branch: master
commit 972968ad1a72af84551c15262a9d4a6a46ffd8fa
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 1f2adab 097/135: Updated copyright, (continued)
- [elpa] master 1f2adab 097/135: Updated copyright, Ian Dunn, 2020/02/17
- [elpa] master e08eae5 096/135: Fixed bugs in parsing multiple forms, Ian Dunn, 2020/02/17
- [elpa] master b86ae49 103/135: Fixed parsing of ! in conditions, Ian Dunn, 2020/02/17
- [elpa] master d5bce9d 133/135: Deprecated org-edna-load and org-edna-unload, Ian Dunn, 2020/02/17
- [elpa] master f6feccf 084/135: Fix bug in keyword completion, Ian Dunn, 2020/02/17
- [elpa] master 7776cb4 079/135: Added documentation for popout editing, Ian Dunn, 2020/02/17
- [elpa] master 3748507 083/135: Add space between edit message and BLOCKER section, Ian Dunn, 2020/02/17
- [elpa] master c05b661 111/135: Added documentation about using a timeout for cache, Ian Dunn, 2020/02/17
- [elpa] master f909703 114/135: Added note about naming conventions., Ian Dunn, 2020/02/17
- [elpa] master b4f7033 104/135: Fixed parsing multiple forms inside if/then/else blocks, Ian Dunn, 2020/02/17
- [elpa] master 972968a 116/135: Modified cache to only work for specific finders,
Ian Dunn <=
- [elpa] master 6287170 122/135: Removed remnants of old build system, Ian Dunn, 2020/02/17
- [elpa] master dcad8cc 113/135: Added org-edna-describe-keyword function, Ian Dunn, 2020/02/17
- [elpa] master dc20076 112/135: Quick fix for handle finders., Ian Dunn, 2020/02/17
- [elpa] master 342f3dd 109/135: Improved contributing section in documentation, Ian Dunn, 2020/02/17
- [elpa] master e6d38ec 086/135: Added relatives finder, Ian Dunn, 2020/02/17
- [elpa] master c02a28f 117/135: Various fixes from testing, Ian Dunn, 2020/02/17
- [elpa] master ef04c24 123/135: Added has-tags? and matches? conditions, Ian Dunn, 2020/02/17
- [elpa] master bf8ecda 135/135: Add 'packages/org-edna/' from commit 'd5bce9db875a7ab2b085aca265ff7f3350d224ba', Ian Dunn, 2020/02/17
- [elpa] master db8a046 124/135: Bumped version, Ian Dunn, 2020/02/17
- [elpa] master 5aad235 126/135: Added function to invalidate cache, Ian Dunn, 2020/02/17