From d0aa2bf33d64a5879cac6d60fbd45b899626a919 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Wed, 19 Jul 2023 19:46:27 +0200 Subject: [PATCH] Restrict Org cache advice to Org 9.5.5 and earlier Org 9.6.7 does not seem to have these performance issues anymore. --- init.el | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/init.el b/init.el index d103fee..17d3923 100644 --- a/init.el +++ b/init.el @@ -963,21 +963,22 @@ ;; parsing all properties of an entry by default. Let’s simplify ;; this to only parse what we are looking for. This makes tag ;; search *much* faster! - (with-eval-after-load 'org - (define-advice org-cached-entry-get (:around - (orig-fun pom property) - speed-up-cache-lookup) - (ignore orig-fun) - (if (or (eq t org-use-property-inheritance) - (and (stringp org-use-property-inheritance) - (let ((case-fold-search t)) - (string-match-p org-use-property-inheritance property))) - (and (listp org-use-property-inheritance) - (member-ignore-case property org-use-property-inheritance))) - ;; Caching is not possible, check it directly. - (org-entry-get pom property 'inherit) - ;; This is different in the original implementation - (org-entry-get pom property)))) + (when (version<= org-version "9.5.5") + (with-eval-after-load 'org + (define-advice org-cached-entry-get (:around + (orig-fun pom property) + speed-up-cache-lookup) + (ignore orig-fun) + (if (or (eq t org-use-property-inheritance) + (and (stringp org-use-property-inheritance) + (let ((case-fold-search t)) + (string-match-p org-use-property-inheritance property))) + (and (listp org-use-property-inheritance) + (member-ignore-case property org-use-property-inheritance))) + ;; Caching is not possible, check it directly. + (org-entry-get pom property 'inherit) + ;; This is different in the original implementation + (org-entry-get pom property))))) ;; Fix (Org 9.5.5): the variable `org-time-was-given' dynamically ;; bound to signify when `org-read-date-analyze' has found a hh:mm