branch: externals/hyperbole
commit 014f5d54f055b6222e575134c640343624bf4aed
Author: bw <[email protected]>
Commit: bw <[email protected]>

    hpath.el, hywiki.el, hui.el - Fix a number of edge case bugs
    
    - fast-demo-outline-section-anchor-and-relative-line-number,
    fast-demo-elisp-or-env-vars - Enable all local vars so are not
    prompted to do so.
    
    - hywiki-word-not-followed-by-p - Add and use where used to check
    only if followed by a #.
    
    - hywiki-cache-save - Remove save of `hyperb:version'  and
    `hywiki-directory' so do not overwrite current values when hywiki
    cache is read in.  Also ensure when reading the cache file in that
    any setting of these variables is ignored.
    
    - hpath:shorten - Fix to return path unchanged if it matches
    `relative-to' (defaults to `default-directory') rather than return
    the empty string.  This fixes the last test in
    `hbut-tests--ibut-operate--name-ignore-region.
    
    - man/hyperbole.texi (Keyboard Drags)
    - hui:link-possible-types - Reprioritize single line region and link
    to Koutline kcell as the first two highest priority types.
    
    - hui:link-possible-types - Add second 'src-buffer' arg needed to
    determine the source of a klink; first arg, `src-dir' is not enough.
    Update code to compare current file name to `src-buffer' one,
    accounting for indirect buffers.
    - hui:ebut-link-directly, hui:ibut-link-directly
    - hy-test-helpers:ensure-link-possible-type - Add 2nd param to call
    of above function.
    - hui:ebut-messag, hui:ibut-message - Fix problem that `actype' was
    getting set to nil when it was a regular function name, not a symbol.
    
    - hui-gibut-create-link-to-file - Remove `referent-start; pos as is
    no longer sent.
    
    - hy-test-helpers-verify-hattr-at-p - Reverse args so expected
    value comes first since most tests are this way.
---
 ChangeLog               |  41 +++++++++++++
 hactypes.el             |   4 +-
 hbut.el                 |   7 ++-
 hpath.el                |   7 +--
 hui.el                  | 139 +++++++++++++++++++++++------------------
 hywiki.el               |  62 ++++++++++---------
 kotl/EXAMPLE.kotl       | 160 +-----------------------------------------------
 man/hyperbole.texi      |   6 +-
 test/demo-tests.el      |  18 +++---
 test/hbut-tests.el      |   8 +--
 test/hui-tests.el       |   4 +-
 test/hy-test-helpers.el |  15 ++---
 12 files changed, 190 insertions(+), 281 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 634608a5aed..39345527804 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,46 @@
+2026-10-19  Bob Weiner  <[email protected]>
+
+* test/demo-tests.el 
(fast-demo-outline-section-anchor-and-relative-line-number,
+                      fast-demo-elisp-or-env-vars): Enable all local
+    vars so are not prompted to do so.
+
+* hywiki.el (hywiki-word-not-followed-by-p): Add and use where used to
+    check only if followed by a #.
+
 2026-10-18  Bob Weiner  <[email protected]>
 
+* hywiki.el (hywiki-cache-save): Remove save of 'hyperb:version'
+    and 'hywiki-directory' so do not overwrite current values
+    when hywiki cache is read in.  Also ensure when reading the
+    cache file in that any setting of these variables is ignored.
+
+* hpath.el (hpath:shorten): Fix to return path unchanged if it
+    matches 'relative-to' (defaults to 'default-directory') rather
+    than return the empty string.  This fixes the last test in
+    'hbut-tests--ibut-operate--name-ignore-region.
+
+* man/hyperbole.texi (Keyboard Drags):
+  hui.el (hui:link-possible-types): Reprioritize single line region
+    and link to Koutline kcell as the first two highest priority types.
+
+* hui.el (hui:link-possible-types): Add second 'src-buffer' arg
+    needed to determine the source of a klink; first arg, 'src-dir'
+    is not enough.  Update code to compare current file name
+    to 'src-buffer' one, accounting for indirect buffers.
+  hui.el (hui:ebut-link-directly, hui:ibut-link-directly):
+  test/hy-test-helpers.el (hy-test-helpers:ensure-link-possible-type):
+    Add 2nd param to call of above function.
+         (hui:ebut-messag, hui:ibut-message): Fix problem that 'actype'
+    was getting set to nil when it was a regular function name, not a
+    symbol.
+
+* test/hui-tests.el (hui-gibut-create-link-to-file): Remove
+    referent-start pos as is no longer sent.
+
+* test/hy-test-helpers.el (hy-test-helpers-verify-hattr-at-p):
+     Reverse args so expected value comes first since most
+     tests are this way.
+
 * hibtypes.el (pathname): Fix when is a url local file:// path,
     don't send pos arg to link-to-file since it is the referent
     pos needed but were sending the src pos instead.
diff --git a/hactypes.el b/hactypes.el
index e9bc86aeccf..3872b82bccd 100644
--- a/hactypes.el
+++ b/hactypes.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    23-Sep-91 at 20:34:36
-;; Last-Mod:     18-Oct-26 at 08:42:03 by Bob Weiner
+;; Last-Mod:     18-Oct-26 at 21:12:57 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -457,7 +457,7 @@ at the top of the window or as close as possible."
           ;; If is a koutline reference with an =idstamp, then update
           ;; reference relative label if need be; this may be in a different
           ;; buffer than the current one.
-          (save-excursion
+          (save-window-excursion
            (klink:update-label path src-start src-buf))))
     (hypb:error "(link-to-file): Invalid file name: \"%s\"" path)))
 
diff --git a/hbut.el b/hbut.el
index 966e71c439d..e83d0060dd8 100644
--- a/hbut.el
+++ b/hbut.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    18-Sep-91 at 02:57:09
-;; Last-Mod:     17-Oct-26 at 22:56:43 by Bob Weiner
+;; Last-Mod:     18-Oct-26 at 23:37:27 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -2739,8 +2739,9 @@ Summary of operations based on inputs (name arg from 
\\='hbut:current attrs):
   (let* ((orig-actype (or (hattr:get ibut 'actype)
                          (hattr:get ibut 'categ)))
         (actype (or (actype:def-symbol (actype:elisp-symbol orig-actype))
-                    (and (symbolp orig-actype) (fboundp orig-actype)
-                         orig-actype)))
+                     ;; This line prevents an Elisp function actype
+                     ;; registering as nil
+                     (actype:elisp-symbol orig-actype)))
         (args   (hattr:get ibut 'args))
         (arg1   (nth 0 args))
         (arg2   (nth 1 args))
diff --git a/hpath.el b/hpath.el
index 2e897f7e99c..c7aec8d12b0 100644
--- a/hpath.el
+++ b/hpath.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     1-Nov-91 at 00:44:23
-;; Last-Mod:     17-Oct-26 at 23:46:29 by Bob Weiner
+;; Last-Mod:     18-Oct-26 at 23:37:26 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -2262,10 +2262,9 @@ used.  Then abbreviate any remaining path."
       (setq relative-to (expand-file-name
                         (hpath:substitute-value relative-to))
            path
-           (cond ((hyperb:stack-frame '(gbut:act))
+           (cond ((or (hyperb:stack-frame '(gbut:act))
+                      (string-equal path relative-to))
                   path)
-                 ((string-equal path relative-to)
-                  "")
                  ((string-equal (file-name-directory path) relative-to)
                   (file-name-nondirectory path))
                  (t (hpath:relative-to path relative-to)))))
diff --git a/hui.el b/hui.el
index 882d33eee1a..82a889b6f40 100644
--- a/hui.el
+++ b/hui.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    19-Sep-91 at 21:42:03
-;; Last-Mod:     27-Sep-26 at 01:27:23 by Bob Weiner
+;; Last-Mod:     18-Oct-26 at 23:03:41 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -577,17 +577,21 @@ runs this command."
     ;; values left over from a prior drag or click.
     (action-key-clear-variables)
     (assist-key-clear-variables))
-  (let (but-lbl edit-flag link-types num-types type-and-args lbl-key but-loc 
but-dir)
-    (cl-multiple-value-bind (link-but-window referent-window)
-       (if (and depress-window release-window)
-           (list depress-window release-window)
-         (hmouse-choose-link-and-referent-windows))
-
+  (cl-multiple-value-bind (link-but-window referent-window)
+      (if (and depress-window release-window)
+         (list depress-window release-window)
+       (hmouse-choose-link-and-referent-windows))
+    (let ((src-buffer (or (buffer-base-buffer (window-buffer link-but-window))
+                          (window-buffer link-but-window)))
+          but-lbl edit-flag link-types num-types type-and-args lbl-key but-loc
+          but-dir)
       (select-window referent-window)
       ;; This sets hbut:current to link-to button attributes.
-      (setq link-types (hui:link-possible-types (buffer-local-value
-                                                 'default-directory
-                                                 (window-buffer 
link-but-window)))
+      (setq link-types (hui:link-possible-types
+                        (buffer-local-value
+                         'default-directory
+                         src-buffer)
+                        src-buffer)
            num-types (length link-types))
 
       (select-window link-but-window)
@@ -1356,18 +1360,21 @@ runs this command."
     ;; values left over from a prior drag or click.
     (action-key-clear-variables)
     (assist-key-clear-variables))
-  (let (but-name edit-flag link-types num-types type-and-args name-key but-loc 
but-dir)
-    ;; edit-flag when set non-nil means are editing an existing ibut at point
-    (cl-multiple-value-bind (link-but-window referent-window)
-       (if (and depress-window release-window)
-           (list depress-window release-window)
-         (hmouse-choose-link-and-referent-windows))
-
+  (cl-multiple-value-bind (link-but-window referent-window)
+      (if (and depress-window release-window)
+         (list depress-window release-window)
+       (hmouse-choose-link-and-referent-windows))
+    (let ((src-buffer (or (buffer-base-buffer (window-buffer link-but-window))
+                          (window-buffer link-but-window)))
+          but-name edit-flag link-types num-types type-and-args name-key
+          but-loc but-dir)
       (select-window referent-window)
       ;; This sets hbut:current to link-to button attributes.
-      (setq link-types (hui:link-possible-types (buffer-local-value
-                                                 'default-directory
-                                                 (window-buffer 
link-but-window)))
+      (setq link-types (hui:link-possible-types
+                        (buffer-local-value
+                         'default-directory
+                         src-buffer)
+                        src-buffer)
            num-types (length link-types))
 
       (select-window link-but-window)
@@ -1379,6 +1386,7 @@ runs this command."
                 (buffer-live-p action-key-depress-buffer))
        (switch-to-buffer action-key-depress-buffer))
       (hui:buf-writable-err (current-buffer) "ibut-link-directly")
+      ;; edit-flag when set non-nil means are editing an existing ibut at point
       (if (ibut:at-p)
          (setq edit-flag t
                but-loc (hattr:get 'hbut:current 'loc)
@@ -1705,11 +1713,12 @@ from the button that point is within."
 (defun hui:ebut-message (but-edit-flag)
   "Display message about the ebut execution.
 With BUT-EDIT-FLAG non-nil message about ebut being edited."
-  (let ((actype (symbol-name (hattr:get 'hbut:current 'actype)))
+  (let ((actype (hattr:get 'hbut:current 'actype))
        (args (hattr:get 'hbut:current 'args)))
     (setq actype (or (actype:def-symbol (actype:elisp-symbol actype))
-                    (when (symbolp actype)
-                       actype)))
+                     ;; This line prevents an Elisp function actype
+                     ;; registering as nil
+                     (actype:elisp-symbol actype)))
     (message "%s%s%s %s %S"
             ebut:label-start
             (hbut:key-to-label (hattr:get 'hbut:current 'lbl-key))
@@ -1958,11 +1967,12 @@ within."
 (defun hui:ibut-message (but-edit-flag)
   "Display message about the ibut execution.
 With BUT-EDIT-FLAG non-nil message about ibut being edited."
-  (let ((actype (symbol-name (hattr:get 'hbut:current 'actype)))
+  (let ((actype (hattr:get 'hbut:current 'actype))
        (args (hattr:get 'hbut:current 'args)))
     (setq actype (or (actype:def-symbol (actype:elisp-symbol actype))
-                    (when (symbolp actype)
-                       actype)))
+                     ;; This line prevents an Elisp function actype
+                     ;; registering as nil
+                     (actype:elisp-symbol actype)))
     (message "%s%s%s %s %S"
             ibut:label-start
              (or (hattr:get 'hbut:current 'name)
@@ -2065,20 +2075,23 @@ which determines the region, ignoring BEG and END."
         (setq completion-to-accept nil))
        (t (kill-region beg end region))))
 
-(defun hui:link-possible-types (src-dir)
-  "Return list of possible link action types during editing of a Hyperbole 
button.
+(defun hui:link-possible-types (src-dir src-buffer)
+  "Return possible link action types list during editing of a Hyperbole button.
 Point must be on the link referent, i.e. in the Action Key release buffer.
-SRC-DIR should be the `default-directory' of the source buffer where the link
-will be added.
-
-Each list element is a list of the link type and any arguments it requires.
+Takes two arguments:
+  SRC-DIR should be the `default-directory' of the source buffer where the
+  link will be added.
+  SRC-BUFFER is where the link will be added.
 
-The link types considered are fixed; this function must be changed to alter
-the contexts recognized.  Defining new link types will not alter the
-possible types.
+Each action type element returned is a list of the link type and any
+arguments it requires.  The link types considered are fixed; this function
+must be changed to alter the contexts recognized.  Defining new link types
+alone will not alter the possible types.
 
 Referent Context         Possible Link Type Returned
 ----------------------------------------------------
+Single-line Region       link-to-string-match
+Koutline Cell            link-to-kcell
 Denote Link              link-to-denote
 EWW Web Page Buffer      link-to-url
 Org Roam or Org Id       link-to-org-id
@@ -2093,8 +2106,6 @@ Texinfo Node             link-to-texinfo-node
 Mail Reader Message      link-to-mail
 Directory Name           link-to-directory
 File Name                link-to-file
-Koutline Cell            link-to-kcell
-Single-line Region       link-to-string-match
 HyWiki Page              link-to-wikiword
 Org Heading              link-to-file
 Outline Heading          link-to-file
@@ -2112,6 +2123,36 @@ Buffer without File      link-to-buffer-tmp"
         heading)
     (prog1 (delq nil
                 (list (cond
+                       ;;
+                       ;; If region is active in the target
+                       ;; buffer and it is one line or less,
+                       ;; then do a link-to-string-match to
+                       ;; the region string.
+                       ((let ((region (and (use-region-p)
+                                           (string-trim 
(buffer-substring-no-properties
+                                                         (region-beginning) 
(region-end)))))
+                              (instance-num 0))
+                          (when (and region
+                                     (not (string-empty-p region))
+                                     ;; single line
+                                     (not (string-match "[\n\r\f]" region)))
+                            (save-excursion
+                              (end-of-line)
+                              (while (search-backward region nil t)
+                                (setq instance-num (1+ instance-num))))
+                            (list 'link-to-string-match region instance-num 
(hypb:buffer-file-name)))))
+                        ;; Koutline kcell link
+                       ((derived-mode-p #'kotl-mode)
+                        (list 'link-to-kcell
+                               (unless (and buffer-file-name
+                                            (equal buffer-file-name
+                                                   (buffer-local-value
+                                                    'buffer-file-name
+                                                    (or (buffer-base-buffer 
src-buffer)
+                                                        src-buffer))))
+                                 (hypb:buffer-file-name))
+                               (concat (kcell-view:label) "="
+                                       (kcell-view:idstamp))))
                         ;; Denote link (with Hyperbole additions)
                         ((setq link-start-end (hsys-denote-link-at-p))
                         (list 'link-to-denote (car link-start-end)))
@@ -2223,30 +2264,6 @@ Buffer without File      link-to-buffer-tmp"
                                     ((let ((hargs:reading-type 'file))
                                        (setq val (hargs:at-p t)))
                                      (list 'link-to-file val))
-                                    ((derived-mode-p #'kotl-mode)
-                                     (list 'link-to-kcell
-                                            (unless (equal (hbut:get-key-src 
t) buffer-file-name)
-                                              (hypb:buffer-file-name))
-                                            (concat (kcell-view:label) "="
-                                                    (kcell-view:idstamp))))
-                                    ;;
-                                    ;; If region is active in the target
-                                    ;; buffer and it is one line or less,
-                                    ;; then do a link-to-string-match to
-                                    ;; the region string.
-                                    ((let ((region (and (use-region-p)
-                                                        (string-trim 
(buffer-substring-no-properties
-                                                                      
(region-beginning) (region-end)))))
-                                           (instance-num 0))
-                                       (when (and region
-                                                  (not (string-empty-p region))
-                                                  ;; single line
-                                                  (not (string-match 
"[\n\r\f]" region)))
-                                         (save-excursion
-                                           (end-of-line)
-                                           (while (search-backward region nil 
t)
-                                             (setq instance-num (1+ 
instance-num))))
-                                         (list 'link-to-string-match region 
instance-num (hypb:buffer-file-name)))))
                                      ;;
                                      ;; If on a HyWiki page when
                                      ;; `hywiki-mode' is enabled,
diff --git a/hywiki.el b/hywiki.el
index 29074410853..8723cadb0a6 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:      5-Oct-26 at 18:35:00 by Bob Weiner
+;; Last-Mod:     19-Oct-26 at 00:44:46 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -1818,9 +1818,11 @@ save and potentially set `hywiki--directory-mod-time' and
        (erase-buffer)
        (princ ";; -*- mode:lisp-data; coding: utf-8-emacs; -*-\n")
 
-       (princ (format "\n(setq\nhyperb:version %S\n" hyperb:version))
-
-       (princ (format "\nhywiki-directory %S\n" hywiki-directory))
+        ;; Don't save these 2 as then when read back, they overwrite the
+        ;; current values improperly.  Left commented here temporarily
+        ;; while testing this change.  -- RSW 2026-10-18
+       ;; (princ (format "\n(setq\nhyperb:version %S\n" hyperb:version))
+       ;; (princ (format "\nhywiki-directory %S\n" hywiki-directory))
 
        ;; Save last `hywiki-directory' mod time and checksum, nil if none.
        (princ (format "\nhywiki--directory-mod-time '%S\n" 
(hywiki-directory-set-mod-time)))
@@ -2871,9 +2873,9 @@ regexps of wikiwords, if the hash table is out-of-date."
        (hywiki-make-referent-hasht))
     (when (and (null hywiki--any-wikiword-regexp-list)
                (not (hash-empty-p hywiki--referent-hasht)))
-      ;; Compute these expensive regexps (matching 50
-      ;; HyWikiWords at a time) only if the set of
-      ;; HyWikiWords changed in `hywiki-directory'.
+      ;; Compute these expensive regexps (matching 50 HyWikiWords at a
+      ;; time in a batch) only if the set of HyWikiWords changed in
+      ;; `hywiki-directory'.
       (setq hywiki--any-wikiword-regexp-list
            (mapcar (lambda (wikiword-sublist)
                      ;; Add plurals to the list
@@ -3727,17 +3729,23 @@ Use `hywiki-word-face' to highlight."
   (let* ((cache-file (hywiki-cache-default-file))
         (cache-buffer (when (file-readable-p cache-file)
                         (find-file-noselect cache-file)))
+         ;; Pre-9.3.1 versions of Hyperbole saved `hyperb:version' and
+         ;; `hywiki-directory' in this cache, improperly overwriting the
+         ;; current values.  To prevent this, we `let' bind these variables
+         ;; during the cache read so that any changes are discarded.
         (hywiki-loaded-flag (when cache-buffer
-                              (with-current-buffer cache-buffer
-                                (widen)
-                                (goto-char (point-min))
-                                ;; Skip past initial comments
-                                (when (re-search-forward "^(" nil t)
-                                  (goto-char (1- (point)))
-                                  (condition-case ()
-                                      (progn (eval (read (buffer-string)))
-                                             t)
-                                    (error nil)))))))
+                               (let ((hyperb:version hyperb:version)
+                                     (hywiki-directory hywiki-directory))
+                                (with-current-buffer cache-buffer
+                                  (widen)
+                                  (goto-char (point-min))
+                                  ;; Skip past initial comments
+                                  (when (re-search-forward "^(" nil t)
+                                    (goto-char (1- (point)))
+                                    (condition-case ()
+                                        (progn (eval (read (buffer-string)))
+                                               t)
+                                      (error nil))))))))
     (if (and hywiki-loaded-flag (not (hywiki-directory-modified-p)))
        ;; Rebuild from loaded data
         (prog1 (setq hywiki--referent-hasht (hash-make hywiki--referent-alist 
t))
@@ -4443,9 +4451,7 @@ non-nil or this will return nil."
                                           (looking-at 
hywiki-word-with-optional-suffix-exact-regexp))
                                         ;; WikiWord ref is the entirety of the 
string
                                         (= end (match-end 0))
-                                        ;; Can't be followed by a # character
-                                        (/= (or (char-after (match-end 0)) 0)
-                                            ?#))
+                                         (hywiki-word-not-followed-by-p))
                                    (setq wikiword (match-string-no-properties 
0)
                                          start (match-beginning 0)
                                          end   (match-end 0))
@@ -4487,9 +4493,7 @@ non-nil or this will return nil."
                                                      hywiki-word-regexp
                                                      "\\(#[^][#()<>{}\" 
\t\n\r\f]*\\)?"
                                                      
hywiki-word-line-and-column-numbers-regexp "?"))
-                                        ;; Can't be followed by a # character
-                                        (/= (or (char-after (match-end 0)) 0)
-                                            ?#)
+                                         (hywiki-word-not-followed-by-p)
                                         (progn (goto-char (match-end 0))
                                                (skip-syntax-forward "-")))
                                    (setq start (match-beginning 0)
@@ -4524,9 +4528,7 @@ non-nil or this will return nil."
                                                      hywiki-word-regexp
                                                      "\\(#[^][#()<>{}\" 
\t\n\r\f]+\\)?"
                                                      
hywiki-word-line-and-column-numbers-regexp "?"))
-                                        ;; Can't be followed by a # character
-                                        (/= (or (char-after (match-end 0)) 0)
-                                            ?#)
+                                         (hywiki-word-not-followed-by-p)
                                         (goto-char (match-end 0)))
                                (setq start (match-beginning 0)
                                      end   (match-end 0)
@@ -4549,9 +4551,7 @@ non-nil or this will return nil."
                                               end (match-end 1)
                                               wikiword (string-trim 
(match-string-no-properties 1))))
                                        ((or (and (looking-at 
hywiki-word-with-optional-suffix-regexp)
-                                                 ;; Can't be followed by a # 
character
-                                                 (/= (or (char-after 
(match-end 0)) 0)
-                                                     ?#))
+                                                  
(hywiki-word-not-followed-by-p))
                                             (and hash-sign-only-flag
                                                  (looking-at (concat 
hywiki-word-regexp "#"))))
                                         (setq start (match-beginning 0)
@@ -4814,6 +4814,10 @@ these are handled by the Org mode link handler."
                    (string-match "#[^][#()<>{}\"\n\r\f]+\\'" word)
                  (length word)))))))
 
+(defun hywiki-word-not-followed-by-p ()
+  "Ensure prior buffer match is not followed by any char in [-_#]."
+  (not (memq (or (char-after (match-end 0)) 0) '(?# ?- ?_))))
+
 (defun hywiki-word-read (&optional prompt initial)
   "Prompt with completion for and return an existing HyWikiWord.
 If point is on one, press RET immediately to use that one."
diff --git a/kotl/EXAMPLE.kotl b/kotl/EXAMPLE.kotl
index 25efd6a4a29..5e39a80e5c6 100644
--- a/kotl/EXAMPLE.kotl
+++ b/kotl/EXAMPLE.kotl
@@ -144,7 +144,7 @@
                | nil         | Demote Tree            | Promote Tree           
 |
                | C-u         | Demote Siblings        | Promote Siblings       
 |
                | C-u C-u     | Reset View Spec        | Reset View Spec        
 |
-               | C-u C-u C-u | Show Whole Outline     | Show Whole Outlin      
 |
+               | C-u C-u C-u | Show Whole Outline     | Show Whole Outline     
 |
                | 0           | Demote and Refill Tree | Promote and Refill 
Tree |
                | 1           | Toggle tab-flag        |                        
 |
                | Other ARG   | Demote Tree ARG Levels | Promote Tree ARG 
Levels |
@@ -552,160 +552,4 @@ alpha ;; label-type
   (creator "[email protected]" create-time "20231105:21:29:07")]
  [81
   (creator "[email protected]" create-time "20261007:21:15:24")]
- [92
-  (creator "[email protected]" create-time "20261016:15:05:05")]
- [93
-  (creator "[email protected]" create-time "20261016:15:05:27")]
- [9
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [10
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [11
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [12
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [82
-  (creator "[email protected]" create-time "20261007:22:18:48")]
- [73
-  (creator "[email protected]" create-time "20260929:05:48:56")]
- [71
-  (creator "[email protected]" create-time "20260928:21:33:05")]
- [74
-  (creator "[email protected]" create-time "20260929:05:49:02")]
- [75
-  (creator "[email protected]" create-time "20260929:05:49:09")]
- [76
-  (creator "[email protected]" create-time "20260929:05:49:14")]
- [78
-  (creator "[email protected]" create-time "20260929:05:50:44")]
- [13
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [85
-  (creator "[email protected]" create-time "20261007:23:56:26")]
- [77
-  (creator "[email protected]" create-time "20260929:05:49:25")]
- [86
-  (creator "[email protected]" create-time "20261008:00:02:09")]
- [88
-  (creator "[email protected]" create-time "20261008:00:02:30")]
- [89
-  (creator "[email protected]" create-time "20261008:00:02:56")]
- [90
-  (creator "[email protected]" create-time "20261008:00:03:52")]
- [14
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [15
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [16
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [17
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [18
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [19
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [20
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [21
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [22
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [23
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [24
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [79
-  (creator "[email protected]" create-time "20261006:04:24:06")]
- [25
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [26
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [27
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [28
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [29
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [30
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [31
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [32
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [33
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [34
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [35
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [36
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [37
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [38
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [39
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [40
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [41
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [42
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [43
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [44
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [45
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [46
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [47
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [48
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [49
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [50
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [51
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [52
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [53
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [54
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [55
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [56
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [57
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [58
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [59
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [60
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [61
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [62
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [63
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [64
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [65
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [66
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [67
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [68
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [69
-  (creator "[email protected]" create-time "20231105:21:29:07")]
- [94
-  (creator "[email protected]" create-time "20261017:07:25:04")]
- nil nil nil nil nil nil nil nil]
+ nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil 
nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil 
nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil 
nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil 
nil nil nil nil nil nil nil]
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index 339a5f128c1..f5201ff7a91 100644
--- a/man/hyperbole.texi
+++ b/man/hyperbole.texi
@@ -7,7 +7,7 @@
 @c Author:       Bob Weiner
 @c
 @c Orig-Date:     6-Nov-91 at 11:18:03
-@c Last-Mod:     18-Oct-26 at 09:47:54 by Bob Weiner
+@c Last-Mod:     18-Oct-26 at 23:06:37 by Bob Weiner
 
 @c %**start of header (This is for running Texinfo on a region.)
 @setfilename hyperbole.info
@@ -1960,6 +1960,8 @@ each one, in decreasing order of priority, as given by the
 @group
 Referent Context         Link Action Type Returned
 ===================================================================
+Single-line Region       link-to-string-match
+Koutline Cell            link-to-kcell
 Denote Link              link-to-denote
 Org Roam or Org Id       link-to-org-id
 HyWikiWord Reference     link-to-wikiword
@@ -1973,8 +1975,6 @@ Texinfo Node             link-to-texinfo-node
 Mail Reader Message      link-to-mail
 Directory Name           link-to-directory
 File Name                link-to-file
-Koutline Cell            link-to-kcell
-Single-line Region       link-to-string-match
 HyWiki Page              link-to-wikiword
 Org Heading              link-to-file
 Outline Heading          link-to-file
diff --git a/test/demo-tests.el b/test/demo-tests.el
index 644420949d9..986d9082635 100644
--- a/test/demo-tests.el
+++ b/test/demo-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <[email protected]>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:     17-Oct-26 at 03:27:37 by Bob Weiner
+;; Last-Mod:     19-Oct-26 at 01:04:48 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -430,15 +430,16 @@
   (dolist (m '(fundamental-mode text-mode))
     (ert-info ((format "With major-mode %s" m))
       (cl-letf (((default-value 'major-mode) m))
-        (dolist (link '("\"HY-NEWS#ORG MODE:3:6\"" "\"HY-NEWS#ORG 
MODE:L3:C6\""))
+        (dolist (link '("\"HY-NEWS#What:2:36\"" "\"HY-NEWS#What:L2:C36\""))
           (unwind-protect
-              (let ((default-directory hyperb:dir))
+              (let ((default-directory hyperb:dir)
+                    (enable-local-variables :all))
                 (with-temp-buffer
                   (insert link)
                   (goto-char 3)
                   (action-key)
                   (should (string= (buffer-name (current-buffer)) "HY-NEWS"))
-                  (should (looking-at-p "M-RET: Reworked"))))
+                  (should (looking-at-p "Bob"))))
             (hy-test-helpers:kill-buffer "HY-NEWS")))))))
 
 (ert-deftest fast-demo-markdown-anchor-with-spaces ()
@@ -457,10 +458,11 @@
   "Verify Elisp or env variables work in paths."
   (unwind-protect
       (with-temp-buffer
-        (insert "\"${hyperb:dir}/HY-NEWS\"")
-        (goto-char 4)
-        (action-key)
-        (should (string= (buffer-name (current-buffer)) "HY-NEWS")))
+        (let ((enable-local-variables :all))
+          (insert "\"${hyperb:dir}/HY-NEWS\"")
+          (goto-char 4)
+          (action-key)
+          (should (string= (buffer-name (current-buffer)) "HY-NEWS"))))
     (hy-test-helpers:kill-buffer "HY-NEWS")))
 
 (ert-deftest fast-demo-elisp-library-in-load-path ()
diff --git a/test/hbut-tests.el b/test/hbut-tests.el
index d56cba78cb3..5b78b9bc2bc 100644
--- a/test/hbut-tests.el
+++ b/test/hbut-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <[email protected]>
 ;;
 ;; Orig-Date:    30-may-21 at 09:33:00
-;; Last-Mod:     17-Oct-26 at 23:56:17 by Bob Weiner
+;; Last-Mod:     18-Oct-26 at 20:04:50 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -383,12 +383,12 @@ Create button with link-to-directory using 
`temporary-file-directory`."
       (should (eq (hattr:get 'hbut:current 'actype) (actype:elisp-symbol 
'link-to-file)))
       (hbut-tests:should-match-tmp-folder (buffer-substring-no-properties 
(point-min) (point-max)))
       ;; Test that ibut:operate produces an error and leaves in-buffer button 
unchanged
+      (hbut-tests:should-match-tmp-folder (buffer-substring-no-properties 
(point-min) (point-max)))
       (erase-buffer)
       (ibut:operate)
       (setq buf-str (buffer-substring-no-properties (point-min) (point-max)))
       (message buf-str)
-      (should (eq (hattr:get 'hbut:current 'actype) 
'display-value-and-remove-region))
-      (hbut-tests:should-match-tmp-folder (buffer-substring-no-properties 
(point-min) (point-max))))))
+      (should (eq (hattr:get 'hbut:current 'actype) (actype:elisp-symbol 
'link-to-file))))))
 
 (ert-deftest hbut-tests--ibut-operate--fail-create-add-name ()
   "Test that trying to add `new-name' to an unnamed ibutton fails when 
`edit-flag' is nil.
@@ -508,7 +508,7 @@ See #10 for the proper way to add an ibutton name.
       (ibut:operate)
       (setq buf-str (buffer-substring-no-properties (point-min) (point-max)))
       (message buf-str)
-      (should (eq (hattr:get 'hbut:current 'actype) 
'display-value-and-remove-region))
+      (should (eq (hattr:get 'hbut:current 'actype) (actype:elisp-symbol 
'link-to-file)))
       (hbut-tests:should-match-tmp-folder (buffer-substring-no-properties 
(point-min) (point-max))))))
 
 (ert-deftest hbut-tests--ibut-operate--region ()
diff --git a/test/hui-tests.el b/test/hui-tests.el
index 0b4ef944a48..8deb1a55ee5 100644
--- a/test/hui-tests.el
+++ b/test/hui-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <[email protected]>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:     17-Oct-26 at 23:50:13 by Bob Weiner
+;; Last-Mod:     18-Oct-26 at 10:11:41 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -304,7 +304,7 @@ Ensure modifying the button but keeping the label does not 
create a double label
          (with-current-buffer test-buffer
             (hy-test-helpers-verify-hattr-at-p
              :actype (actype:elisp-symbol 'link-to-file)
-             :args (list test-file 13)
+             :args (list test-file)
              :loc test-file
             :lbl-key (ibut:label-to-key test-file)
             :name "global")))
diff --git a/test/hy-test-helpers.el b/test/hy-test-helpers.el
index 85485623c32..504faaca705 100644
--- a/test/hy-test-helpers.el
+++ b/test/hy-test-helpers.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <[email protected]>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:     16-Oct-26 at 18:42:29 by Mats Lidell
+;; Last-Mod:     18-Oct-26 at 20:04:41 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -43,7 +43,8 @@
 
 (defun hy-test-helpers:ensure-link-possible-type (type)
   "At point, ensure `hui:link-possible-types' returns a single TYPE."
-  (let* ((possible-types (hui:link-possible-types default-directory))
+  (let* ((possible-types (hui:link-possible-types default-directory
+                                                  (current-buffer)))
         (first-type (caar possible-types)))
     (should (= (length possible-types) 1))
     (should (equal first-type type))))
@@ -98,11 +99,11 @@ processing."
   "Verify the attribute of hbut at point.
 Checks ACTYPE, ARGS, LOC, LBL-KEY and NAME."
   (hbut:at-p)
-  (should (eq (hattr:get 'hbut:current 'actype) actype))
-  (should (equal (hattr:get 'hbut:current 'args) args))
-  (should (equal (hattr:get 'hbut:current 'loc) loc))
-  (should (equal (hattr:get 'hbut:current 'lbl-key) lbl-key))
-  (should (equal (hattr:get 'hbut:current 'name) name)))
+  (should (eq actype     (hattr:get 'hbut:current 'actype)))
+  (should (equal args    (hattr:get 'hbut:current 'args)))
+  (should (equal loc     (hattr:get 'hbut:current 'loc)))
+  (should (equal lbl-key (hattr:get 'hbut:current 'lbl-key)))
+  (should (equal name    (hattr:get 'hbut:current 'name))))
 
 (defun hy-delete-file-and-buffer (file)
   "Delete FILE and buffer visiting file."

Reply via email to