From e07dbdd2e70db2e6c5543a8de58da12ccf1bc5cb Mon Sep 17 00:00:00 2001 From: Noboru Ota Date: Sat, 2 Nov 2024 20:28:17 +0100 Subject: [PATCH] fix: args-out-of-range error during loading highlights #89 --- org-remark.el | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/org-remark.el b/org-remark.el index 803c0c9..3f9f809 100644 --- a/org-remark.el +++ b/org-remark.el @@ -1690,17 +1690,18 @@ process." "Org-remark: error during loading highlights: %S" ;; Load highlights with demoted errors -- this makes the loading ;; robust against errors in loading. - (dolist (highlight (org-remark-highlights-get notes-buf)) - (let ((ov (org-remark-highlight-load highlight))) - (when ov (push ov overlays)))) - (unless update (org-remark-notes-setup notes-buf source-buf)) - (if overlays - (progn (run-hook-with-args 'org-remark-highlights-after-load-functions - overlays notes-buf) - ;; Return t - t) - ;; if there is no overlays loaded, return nil - nil)))))) + (org-with-wide-buffer + (dolist (highlight (org-remark-highlights-get notes-buf)) + (let ((ov (org-remark-highlight-load highlight))) + (when ov (push ov overlays)))) + (unless update (org-remark-notes-setup notes-buf source-buf)) + (if overlays + (progn (run-hook-with-args 'org-remark-highlights-after-load-functions + overlays notes-buf) + ;; Return t + t) + ;; if there is no overlays loaded, return nil + nil))))))) (defun org-remark-highlights-clear () "Delete all highlights in the buffer.