branch: externals/hyperbole
commit cedb62648914b7f56681419ea41056537ad95d1a
Author: bw <r...@gnu.org>
Commit: bw <r...@gnu.org>

    hywiki.el - Eliminate circular dep on `hywiki--buttonize-characters'
---
 ChangeLog | 4 ++++
 hywiki.el | 8 +++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5c1a29157f..01d653c9d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2024-05-19  Bob Weiner  <r...@gnu.org>
 
+* hywiki.el (hywiki-remap-buttonize-characters): Move initialization of
+    'hywiki--buttonize-characters' here instead of at variable definition
+    to eliminate circular load dependency.
+
 * hibtypes.el (grep-msg): Fix that when no source-loc, file path was not
     expanded.
               (find-func): Add require of this library for native compiler
diff --git a/hywiki.el b/hywiki.el
index f822288bc5..a12584a900 100644
--- a/hywiki.el
+++ b/hywiki.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     21-Apr-24 at 22:41:13
-;; Last-Mod:     19-May-24 at 04:10:28 by Bob Weiner
+;; Last-Mod:     19-May-24 at 04:18:40 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -143,8 +143,7 @@ the HyWiki word and grouping 2 is the #section with the # 
included.")
 ;;; Private variables
 ;;; ************************************************************************
 
-(defvar hywiki--buttonize-characters
-  (concat " \r\n\)\]\>\}'" (hywiki-get-buttonize-characters))
+(defvar hywiki--buttonize-characters nil
   "String of single character keys bound to `hywiki-buttonize'.
 Each such key self-inserts before highlighting any prior HyWiki word.")
 
@@ -248,6 +247,9 @@ Do this only if the expression is an implicit button of 
hywiki type."
 
 (defun hywiki-remap-buttonize-characters ()
   "Remap Org self-insert punct/sym keys in `hywiki-mode` to 
`hywiki-buttonize`."
+  (unless hywiki--buttonize-characters
+    (setq hywiki--buttonize-characters
+         (concat " \r\n\)\]\>\}'" (hywiki-get-buttonize-characters))))
   (mapc (lambda (c) (define-key hywiki-mode-map (char-to-string c) 
'hywiki-buttonize))
        hywiki--buttonize-characters))
 

Reply via email to