From d53f0e60bfcba416c7ee2cb87f19b849311e0f51 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Thu, 22 Apr 2021 00:37:19 +0800 Subject: [PATCH] org-roam-db-sync: support emacs 26.1 don't use dolist with progress report if it does not exist. results in slightly degraded experience, but at least it works. --- org-roam-db.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/org-roam-db.el b/org-roam-db.el index 6ba54b0..bead414 100644 --- a/org-roam-db.el +++ b/org-roam-db.el @@ -425,12 +425,18 @@ If FORCE, force a rebuild of the cache from scratch." contents-hash) (push file modified-files))) (remhash file current-files)) - (dolist-with-progress-reporter (file (hash-table-keys current-files)) - "Clearing removed files..." - (org-roam-db-clear-file file)) - (dolist-with-progress-reporter (file modified-files) - "Processing modified files..." - (org-roam-db-update-file file)))) + (if (fboundp 'dolist-with-progress-reporter) + (dolist-with-progress-reporter (file (hash-table-keys current-files)) + "Clearing removed files..." + (org-roam-db-clear-file file)) + (dolist (file (hash-table-keys current-files)) + (org-roam-db-clear-file file))) + (if (fboundp 'dolist-with-progress-reporter) + (dolist-with-progress-reporter (file modified-files) + "Processing modified files..." + (org-roam-db-update-file file)) + (dolist (file modified-files) + (org-roam-db-update-file file))))) (defun org-roam-db-update-file (&optional file-path) "Update Org-roam cache for FILE-PATH.