emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org-remark 782206a4ab 2/2: fix: duplicate Info mode hig


From: ELPA Syncer
Subject: [elpa] externals/org-remark 782206a4ab 2/2: fix: duplicate Info mode highlights in the first load
Date: Sun, 30 Jul 2023 09:58:26 -0400 (EDT)

branch: externals/org-remark
commit 782206a4ab9cd492c4a1cd45376f9f4bb1faa839
Author: Noboru Ota <me@nobiot.com>
Commit: Noboru Ota <me@nobiot.com>

    fix: duplicate Info mode highlights in the first load
---
 org-remark-info.el | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/org-remark-info.el b/org-remark-info.el
index cbfaa6d147..1e038efece 100644
--- a/org-remark-info.el
+++ b/org-remark-info.el
@@ -5,7 +5,7 @@
 ;; Author: Noboru Ota <me@nobiot.com>
 ;; URL: https://github.com/nobiot/org-remark
 ;; Created: 16 July 2023
-;; Last modified: 29 July 2023
+;; Last modified: 30 July 2023
 ;; Package-Requires: ((emacs "27.1") (org "9.4"))
 ;; Keywords: org-mode, annotation, note-taking, marginal-notes, wp
 
@@ -86,7 +86,16 @@ It is necessary as this function is intended to be used as 
part
 of advice for `Info-goto-node', which gets arguments passed to
 it. `org-remark-highlights-load' should be called with no
 arguments for the purpose of `org-remark-info-mode'."
-  (org-remark-highlights-load))
+  ;; Enabling `org-remark-mode' runs `org-remark-highlight', which would
+  ;; result in duplicating the highlights if
+  ;; `org-remark-highlights-load' is run again. As this function must be
+  ;; run only once for initial load and only once for subsequent
+  ;; re-load, initial load and re-load needs to be differentiated. This
+  ;; `if' clause is meant to do this.
+  (if (or (not (featurep 'org-remark))
+          (not org-remark-mode))
+      (org-remark-mode +1)
+    (org-remark-highlights-load)))
 
 (defun org-remark-info-get-node ()
   "Return the current Info file/node."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]