From f22990d611a794d56bb6ac149f53b0779d24a0ca Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Fri, 27 May 2022 14:46:54 +0200 Subject: [PATCH] Revert "Remove possibly obsolete Org mode fix" This reverts commit fa7c7ca3edbea7d5f808008bfeed4d0c59dd5d0d. The hack is still necessary, as otherwise listing stuck Org projects takes too long. --- init.el | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index a79acef..0d5866c 100644 --- a/init.el +++ b/init.el @@ -919,7 +919,24 @@ (unless (memq #'org-clock-save (mapcar #'timer--function timer-list)) - (run-with-timer 0 3600 #'org-clock-save)))) + (run-with-timer 0 3600 #'org-clock-save)) + + ;; Hack: The default implementation is too slow, because it is + ;; 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 + (defun org-cached-entry-get (pom property) + (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)))))) ;; Drag-and-Drop images into org-mode buffer (use-package org-download