branch: externals/hyperbole
commit b550fbe6a9c2579ecf3cbf1ee2633cb6f89ad8f6
Merge: 15c494d18c ba84fc6100
Author: bw <[email protected]>
Commit: bw <[email protected]>

    Merge branch 'master' into rsw
---
 .dir-locals.el       |  9 +++++++++
 ChangeLog            | 16 ++++++++++++++++
 MANIFEST             |  1 +
 Makefile             |  5 +++--
 test/hywiki-tests.el | 30 ++++++++++++++++++++----------
 5 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 0000000000..65424390bc
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1,9 @@
+;;; Directory Local Variables         -*- no-byte-compile: t; -*-
+;;; For more information see (info "(emacs) Directory Variables")
+
+((nil . ((tab-width . 8)
+         (fill-column . 76)
+         (emacs-lisp-docstring-fill-column . 76)))
+ (emacs-lisp-mode . ((indent-tabs-mode . nil)))
+ (lisp-data-mode . ((indent-tabs-mode . nil))))
+
diff --git a/ChangeLog b/ChangeLog
index 2218bc1fb0..ccf8f395e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,22 @@
              hywiki-get-page-headings,
              hywiki-word-from-reference): Add and use in completions.
 
+2026-02-10  Mats Lidell  <[email protected]>
+
+* .dir_locals.el: Project editing settings.
+  Makefile (HYPERBOLE_FILES):
+  MANIFEST: Add .dir_locals.el
+
+2026-02-09  Mats Lidell  <[email protected]>
+
+* test/hywiki-tests.el (hywiki-tests--word-at): Extend verification to
+    verify that the range of the WikiWord and the range of the
+    highlighted text is equal iff a highlighted WikiWord exists.
+    (hywiki-tests--run-test-case): Use pos as given by the step
+    definition. If an illegal position results the test specification is
+    wrong and need to be changed. Give an error message that explains the
+    problem.
+
 2026-02-09  Bob Weiner  <[email protected]>
 
 * test/hywiki-tests.el (hywiki-tests--edit): Report expected errors as messages
diff --git a/MANIFEST b/MANIFEST
index 2c371de1ed..bf322dbced 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -105,6 +105,7 @@ hyperbole-banner.png - Graphic of GNU Hyperbole for display 
with About Hyperbole
 smart-clib-sym       - Test whether symbol appears within a set of C libraries
 topwin.py            - Python script to find the topmost macOS app window at a 
screen position
 .hypb & _hypb        - Button data files used by the GNU Hyperbole DEMO file
+.dir_locals.el       - Project editing settings
 
 * --- EXTERNAL SYSTEM ENCAPSULATIONS ---
 hsys-activities.el   - GNU Hyperbole support functions for Activities
diff --git a/Makefile b/Makefile
index 3fda256e74..b85276f45d 100644
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,9 @@
 # Author:       Bob Weiner
 #
 # Orig-Date:    15-Jun-94 at 03:42:38
-# Last-Mod:     11-Dec-25 at 09:51:43 by Mats Lidell
+# Last-Mod:     10-Feb-26 at 17:05:17 by Mats Lidell
 #
-# Copyright (C) 1994-2025  Free Software Foundation, Inc.
+# Copyright (C) 1994-2026  Free Software Foundation, Inc.
 # See the file HY-COPY for license information.
 #
 # This file is part of GNU Hyperbole.
@@ -241,6 +241,7 @@ HYPERBOLE_FILES = dir info html $(EL_SRC) $(EL_KOTL) \
         HY-CONCEPTS.kotl HY-NEWS HY-WHY.kotl $(wildcard hywiki/*.org) \
         INSTALL DEMO DEMO-ROLO.otl FAST-DEMO MANIFEST README.md TAGS _hypb \
         .hypb hyrolo.py smart-clib-sym topwin.py hyperbole-banner.png \
+       .dir-locals.el \
        $(man_dir)/hkey-help.txt $(man_dir)/hyperbole.texi 
$(man_dir)/hyperbole.css \
         $(man_dir)/texinfo-7.css
 
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index 3adbfd4223..a9aa5ac46e 100644
--- a/test/hywiki-tests.el
+++ b/test/hywiki-tests.el
@@ -1493,12 +1493,23 @@ comparison with expected overlays stable."
   "Non-nil to perform face validation of WikiWord.")
 
 (defun hywiki-tests--word-at ()
-  "Test if there is a HyWikiWord reference at point with a referent.
-Choose what test to perform based on value of `hywiki-tests--with-face-test'."
-  (when (hywiki-referent-exists-p)
-    (if hywiki-tests--with-face-test
-       (hywiki-highlighted-word-at)
-      (hywiki-word-at))))
+  "Return potential HyWikiWord and optional #section:Lnum:Cnum at point or nil.
+When `hywiki-tests--with-face-test' is non-nil the HyWikiWord must be
+highlighted to be returned.  When it is highlighted, the range of the
+highlighting and the range of the HyWikiWord is, as a side effect,
+checked for consistency."
+  (let* ((range (hywiki-referent-exists-p :range))
+         (wikiword (car range)))
+    (when wikiword
+      (if (not hywiki-tests--with-face-test)
+          wikiword
+        (save-excursion
+          (goto-char (round (/ (+ (cadr range) (caddr range)) 2.0)))
+          (let* ((highlighted-range (hywiki-highlighted-word-at :range))
+                 (highlighted-wikiword (car highlighted-range)))
+            (when highlighted-wikiword
+              (should (equal range highlighted-range)))
+            highlighted-wikiword))))))
 
 (defun hywiki-tests--verify-hywiki-word (step expected)
   "Verify that `hywiki-word-at' returns t if a wikiword is EXPECTED.
@@ -1560,11 +1571,10 @@ point when the function is called."
                        (hywiki-tests--command-execute #'backward-delete-char 
1)))
                    (hywiki-tests--verify-hywiki-word step vfy)))
                ((and (symbolp step) (string-prefix-p "p" (symbol-name step)))
-                (let* ((pos (string-to-number (substring (symbol-name step) 
1)))
-                       (newpos (max (min (+ origin (1- pos)) (point-max))
-                                    (point-min))))
+                 (let* ((pos (string-to-number (substring (symbol-name step) 
1)))
+                        (newpos (+ origin (1- pos))))
                    (when (or (> (point-min) newpos) (< (point-max) newpos))
-                     (ert-fail (format "New point: '%s' is outside of buffer" 
newpos)))
+                     (ert-fail (format "Error in test specification. Step '%s' 
moves point to pos '%s' outside of buffer" step newpos)))
                    (goto-char newpos))
                 (hywiki-tests--verify-hywiki-word step vfy))
                (t (ert-fail (format "Unknown step: '%s' in WikiWord 
verification" step)))))))))

Reply via email to