From 3079a3133f7cfbada390c82a1632f8eb8c80c909 Mon Sep 17 00:00:00 2001 From: Kristoffer Balintona Date: Fri, 1 Nov 2024 10:16:36 -0500 Subject: [PATCH] fix: Correct logic when implementing `org-remark-report-no-highlights` Currently, if `org-remark-report-no-highlights` is non-nil and there are no highlights in the current file, then `org-remark-highlights-get` will incorrectly execute code relevant to showing highlights (throwing an error) due to erroneous logic. This commit fixes the erroneous logic. --- org-remark.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/org-remark.el b/org-remark.el index 819d864..637baa8 100644 --- a/org-remark.el +++ b/org-remark.el @@ -1618,9 +1618,10 @@ highlight is a property list in the following properties: (org-with-wide-buffer (let ((heading (org-find-property org-remark-prop-source-file source-file-name))) - (if (and (not heading) org-remark-report-no-highlights) - (message "No highlights or annotations found for %s." - source-file-name) + (if (not heading) + (when org-remark-report-no-highlights + (message "No highlights or annotations found for %s." + source-file-name)) (goto-char heading) ;; Narrow to only subtree for a single file. `org-find-property' ;; ensures that it is the beginning of a headline