branch: externals/hyperbole
commit f7015e625fabb74b1ad20d1b6676c06c30058cac
Merge: 42dcd71f59 1a2de336f5
Author: Robert Weiner <r...@gnu.org>
Commit: GitHub <nore...@github.com>

    Merge pull request #707 from rswgnu/rsw
    
    kotl-mode:add-prior-cell - Add; start fix of kotl-mode:add-cell
---
 ChangeLog               | 42 +++++++++++++++++++++++++
 hbut.el                 |  9 +++++-
 hui.el                  | 25 +++++++++------
 kotl/EXAMPLE.kotl       |  8 +++--
 kotl/kmenu.el           |  4 +--
 kotl/kotl-mode.el       | 84 ++++++++++++++++++++++++++++++++-----------------
 man/hyperbole.texi      | 24 ++++++++------
 test/demo-tests.el      | 25 +++++++++------
 test/hui-tests.el       | 10 +++---
 test/kotl-mode-tests.el |  8 ++---
 10 files changed, 167 insertions(+), 72 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9ee5bae231..ff85eac283 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+2025-04-20  Bob Weiner  <r...@gnu.org>
+
+* test/hui-tests.el (hui--link-possible-types): Change Outline Heading
+    to use 'link-to-file' now.
+                    (hui--ibut-link-directly-to-org-header-second-column):
+    Fix to new handling of outline headings.
+
+* test/demo-tests.el (fast-demo-display-kotl-starting-from-cell): Fix
+    to use Hyperbole source EXAMPLE.kotl rather than per user file
+    which may have been edited.  Also add check of count of visible lines
+    in the current cell.
+
+* kotl/kotl-mode.el (kotl-mode:add-prior-cell): Add to insert a cell
+    prior to the current cell at the same level as the current cell.
+
+* kotl/kmenu.el (kotl-menu-common-body): Change 'Add-Parent' to
+    'Add-After-Parent'.
+
+* kotl/kotl-mode.el (kotl-mode:add-parent): Rename to
+   'kotl-mode:add-after-parent'.
+
+2025-04-19  Bob Weiner  <r...@gnu.org>
+
+* kotl/kotl-mode.el (kotl-mode:add-cell): Fix handling of 0 and negative
+   prefix args.  0 on a level 1 cell means add as the first child of the
+   parent root cell, i.e. as the first outline cell.  0 at any lower level
+   means add as the next sibling of the parent cell.
+                    (kotl-mode:down-level, kotl-mode:up-level,
+                     kotl-mode:backward-cell, kotl-mode:forward-cell,
+                     kotl-mode:previous-cell, kotl-mode:next-cell): Trigger
+   error only if called interactively; if not interactive and cannot move
+   to any expected cell, return nil.
+
+* hui.el (hui:actype): Fix to ensure only interactive actypes are returned
+    so when an explict button is created, it can prompt for the parameters
+    associated with the actype (otherwise, it will just get nil).
+         (hui:link-possible-types): Update link to outline heading handler
+    to use 'link-to-file' instead of 'link-to-string-match'.  Ignore the
+    column number of point and for instance number of the #section, count
+    only matches to heading lines, i.e. with 'outline-regexp'.
+  hbut.el (ibut:insert-text): Add support for 'link-to-file'.
+
 * hibtypes.el (hywiki-existing-word):
   hywiki.el (hywiki-word): Fix so if point is on an existing pathname that
     is also a WikiWord, it jumps to the pathname rather than displaying the
diff --git a/hbut.el b/hbut.el
index bc250da9f0..4b4b45525d 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:     16-Apr-25 at 10:42:06 by Mats Lidell
+;; Last-Mod:     20-Apr-25 at 15:16:34 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -2700,6 +2700,13 @@ Summary of operations based on inputs (name arg from 
\\='hbut:current attrs):
       ('actypes::link-to-ebut (progn (insert "<elink:" arg1)
                                     (when arg2 (insert ": " arg2))
                                     (insert ">")))
+      ('actypes::link-to-file
+       ;; arg2 when given is a buffer position
+       (insert "\""
+              (if arg2
+                  (hpath:file-position-to-line-and-column arg1 arg2)
+                (hpath:shorten arg1))
+              "\""))
       ('actypes::link-to-ibut (progn (insert "<ilink:" arg1)
                                     (when arg2 (insert ": " arg2))
                                     (insert ">")))
diff --git a/hui.el b/hui.el
index d7285acd9a..5545d66a97 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:     14-Apr-25 at 23:27:50 by Bob Weiner
+;; Last-Mod:     20-Apr-25 at 15:15:12 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -1473,11 +1473,15 @@ Trigger an error if DEFAULT-ACTYPE is invalid."
     (setq default-actype (symbol-name default-actype)
          default-actype (actype:def-symbol default-actype)
          default-actype (when default-actype (symbol-name default-actype))))
-  (if (or (null default-actype) (stringp default-actype))
+  (if (or (null default-actype)
+         (and (stringp default-actype)
+              (commandp (actype:elisp-symbol default-actype))))
       (let ((actype-name
             (hargs:read-match (or prompt "Button's action type: ")
                               (nconc
-                               (mapcar #'list (htype:names 'actypes))
+                               (mapcar (lambda (sym)
+                                         (list (symbol-name (actype:def-symbol 
sym))))
+                                       (seq-filter #'commandp (htype:category 
'actypes)))
                                (mapcar #'list (all-completions "" obarray
                                                                (lambda (sym) 
(commandp sym t)))))
                               nil t default-actype 'actype)))
@@ -1917,7 +1921,7 @@ Directory Name           link-to-directory
 File Name                link-to-file
 Koutline Cell            link-to-kcell
 Single-line Region       link-to-string-match
-Outline Heading          link-to-string-match
+Outline Heading          link-to-file
 Buffer attached to File  link-to-file
 EOL in Dired Buffer      link-to-directory (Dired dir)
 Buffer without File      link-to-buffer-tmp"
@@ -2026,13 +2030,14 @@ Buffer without File      link-to-buffer-tmp"
                                                  (when (not (string-empty-p 
heading))
                                                    (save-excursion
                                                      (end-of-line)
-                                                     (while (search-backward 
heading nil t)
+                                                     (while 
(re-search-backward (format hpath:outline-section-pattern (regexp-quote 
heading))
+                                                                               
 nil t)
                                                        (setq instance-num (1+ 
instance-num))))
-                                                   (list 'link-to-string-match
-                                                         (if (zerop 
(current-column))
-                                                             heading
-                                                           (format "%s:L1:C%d" 
heading (current-column)))
-                                                         instance-num 
(hypb:buffer-file-name))))))
+                                                   (list 'link-to-file
+                                                         (format "%s#%s%s"
+                                                                 
(hypb:buffer-file-name)
+                                                                 heading
+                                                                 (if (> 
instance-num 1) (format ":I%d" instance-num) "")))))))
                                          ((hypb:buffer-file-name)
                                           (list 'link-to-file 
(hypb:buffer-file-name) (point)))
                                          ((derived-mode-p 'dired-mode)
diff --git a/kotl/EXAMPLE.kotl b/kotl/EXAMPLE.kotl
index 9b3214caac..65bb2c64bf 100644
--- a/kotl/EXAMPLE.kotl
+++ b/kotl/EXAMPLE.kotl
@@ -38,9 +38,11 @@
             least two characters long.
 
        3b3. Cell Creation: {C-j} adds a new cell as a sibling following the
-            current cell.  A non-negative prefix argument, {C-u C-j} or {C-c
-            a} adds the cell as a child of the current cell.  {C-c p} adds the
-            cell as the sibling of the current cell's parent.
+            current cell.  {C-u C-j} or {C-c a} adds the cell as a child of
+            the current cell.  Any other positive prefix arg to {C-j} adds
+            that many following cells at the same level as the current one.
+            {C-c p} adds the cell as the sibling of the current cell's
+            parent.
 
        3b4. Cell and Tree Deletion: {C-c C-k} kills the current cell and its
             entire subtree.  {C-c k} kills the contents of a cell from point
diff --git a/kotl/kmenu.el b/kotl/kmenu.el
index 7dc8bf6c00..42780da11d 100644
--- a/kotl/kmenu.el
+++ b/kotl/kmenu.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    28-Mar-94 at 11:22:09
-;; Last-Mod:     25-Nov-24 at 22:11:56 by Mats Lidell
+;; Last-Mod:     20-Apr-25 at 00:28:33 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -43,9 +43,9 @@
       ["Promote"             kotl-mode:promote-tree
        :active t :keys "M-TAB"]
       "----"
+      ["Add-After-Parent"    kotl-mode:add-after-parent     t]
       ["Add-Child"           kotl-mode:add-child            t]
       ["Add-Cell"            kotl-mode:add-cell             t]
-      ["Add-Parent"          kotl-mode:add-parent           t]
       ["Append-Cell"         kotl-mode:append-cell          t]
       ["Split-Cell"          kotl-mode:split-cell           t]
       "----"
diff --git a/kotl/kotl-mode.el b/kotl/kotl-mode.el
index f84eba0832..cb74fea051 100644
--- a/kotl/kotl-mode.el
+++ b/kotl/kotl-mode.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    6/30/93
-;; Last-Mod:     29-Jan-25 at 18:57:50 by Mats Lidell
+;; Last-Mod:     20-Apr-25 at 01:05:24 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -1465,7 +1465,8 @@ doc string for `insert-for-yank-1', which see."
 
 (defun kotl-mode:backward-cell (arg)
   "Move to prefix ARGth prior visible cell (same level) within current view.
-Return number of cells left to move."
+Return number of cells left to move.  Error if called interactively and
+cannot move to the desired cell."
   (interactive "p")
   (kotl-mode:maintain-region-highlight)
   (if (< arg 0)
@@ -1626,7 +1627,8 @@ Leave point at the start of the cell."
     (kotl-mode:beginning-of-cell)))
 
 (defun kotl-mode:down-level (arg)
-  "Move down prefix ARG levels lower within current tree."
+  "Move down prefix ARG levels lower within current tree.
+Error if called interactively and cannot move to the desired cell."
   (interactive "p")
   (kotl-mode:maintain-region-highlight)
   (if (< arg 0)
@@ -1638,12 +1640,14 @@ Leave point at the start of the cell."
        (unless child
          (setq child t))
        (setq arg (1- arg)))
-      ;; Signal an error if couldn't move down at least 1 child level.
+      ;; Signal an error if called interactively and couldn't move
+      ;; down at least 1 child level.
       (or child
          (progn
            (goto-char (mark t))
            (pop-mark)
-           (error "(kotl-mode:down-level): No child level to which to 
move"))))))
+           (when (called-interactively-p 'interactive)
+             (error "(kotl-mode:down-level): No child level to which to 
move")))))))
 
 (defun kotl-mode:end-of-buffer ()
   "Move point to end of buffer and return point."
@@ -1729,7 +1733,8 @@ already within the first sibling cell."
 
 (defun kotl-mode:forward-cell (arg)
   "Move to prefix ARGth following cell (same level) within current view.
-Return number of cells left to move."
+Return number of cells left to move.  Error if called interactively and
+cannot move to the desired cell."
   (interactive "p")
   (kotl-mode:maintain-region-highlight)
   (if (< arg 0)
@@ -1964,7 +1969,8 @@ The paragraph marked is the one that contains point or 
follows point."
   (kotl-mode:beginning-of-buffer))
 
 (defun kotl-mode:next-cell (arg)
-  "Move to prefix ARGth next cell (any level) within current view."
+  "Move to prefix ARGth next cell (any level) within current view.
+Error if called interactively and cannot move to the desired cell."
   (interactive "p")
   (kotl-mode:maintain-region-highlight)
   (if (< arg 0)
@@ -1973,7 +1979,7 @@ The paragraph marked is the one that contains point or 
follows point."
          (lbl-sep-len (kview:label-separator-length kotl-kview)))
       (while (and (> arg 0) (setq next (kcell-view:next t lbl-sep-len)))
        (setq arg (1- arg)))
-      (if next
+      (if (or next (not (called-interactively-p 'interactive)))
          arg
        (error "(kotl-mode:next-cell): Last cell")))))
 
@@ -2044,7 +2050,8 @@ non-nil iff there is a next tree within the koutline."
   (point))
 
 (defun kotl-mode:previous-cell (arg)
-  "Move to prefix ARGth previous cell (any level) within current view."
+  "Move to prefix ARGth previous cell (any level) within current view.
+Error if called interactively and cannot move to the desired cell."
   (interactive "p")
   (kotl-mode:maintain-region-highlight)
   (if (< arg 0)
@@ -2060,7 +2067,7 @@ non-nil iff there is a next tree within the koutline."
       (while (and (> arg 0) (setq previous
                                  (kcell-view:previous t lbl-sep-len)))
        (setq arg (1- arg)))
-      (if previous
+      (if (or previous (not (called-interactively-p 'interactive)))
          arg
        (error "(kotl-mode:previous-cell): First cell")))))
 
@@ -2095,7 +2102,8 @@ If at tail cell already, do nothing and return nil."
     moved))
 
 (defun kotl-mode:up-level (arg)
-  "Move up prefix ARG levels higher in current outline view."
+  "Move up prefix ARG levels higher in current outline view.
+Error if called interactively and cannot move to the desired cell."
   (interactive "p")
   (kotl-mode:maintain-region-highlight)
   (if (< arg 0)
@@ -2108,13 +2116,14 @@ If at tail cell already, do nothing and return nil."
       (while (and (> arg 0) (setq result (kcell-view:parent t lbl-sep-len)))
        (or parent (setq parent result))
        (setq arg (if (eq result 0) 0 (1- arg))))
-      ;; Signal an error if couldn't move up at least 1 parent level.
+      ;; Signal an error if called interactively and couldn't move up
+      ;; at least 1 parent level.
       (or (and parent (not (eq parent 0)))
          (progn
            (goto-char (mark t))
            (pop-mark)
-           (error "(kotl-mode:up-level): No parent level to which to 
move"))))))
-
+       (when (called-interactively-p 'interactive)
+         (error "(kotl-mode:up-level): No parent level to which to move")))))))
 
 ;;; ------------------------------------------------------------------------
 ;;; Predicates
@@ -2287,8 +2296,10 @@ If assist-key is pressed:
   (interactive "*")
   (kotl-mode:add-cell '(4)))
 
-(defun kotl-mode:add-parent ()
-  "Add a new cell to current kview as sibling of current cell's parent."
+(defun kotl-mode:add-after-parent ()
+  "Add a new cell to current kview after current cell's parent.
+If parent is the hidden root cell 0, then add as the first cell of the
+outline.  Otherwise, add it as the next sibling of the parent cell."
   (interactive "*")
   (kotl-mode:add-cell -1))
 
@@ -2313,32 +2324,39 @@ Return last newly added cell."
   (let ((klabel (kcell-view:label))
        (lbl-sep-len (kview:label-separator-length kotl-kview))
        cell-level new-cell sibling-p child-p start parent
-       cells-to-add)
+       cells-to-add parent-level)
     (setq cell-level (kcell-view:level nil lbl-sep-len)
          child-p (equal relative-level '(4))
          sibling-p (and (not child-p)
                         (cond ((not relative-level) 1)
                               ((>= (prefix-numeric-value relative-level) 0)
                                (prefix-numeric-value relative-level))))
+         parent-level (1- cell-level)
          cells-to-add (or sibling-p 1))
     (if child-p
        (setq cell-level (1+ cell-level))
       (unless sibling-p
-       ;; Add as following sibling of current cell's parent.
-       ;; Move to parent.
-       (setq cell-level (1- cell-level)
+       (setq cell-level (if (zerop parent-level) cell-level (1- cell-level))
              start (point)
              parent (kcell-view:parent nil lbl-sep-len))
-       (unless (eq parent t)
+       (unless (memq parent '(0 t))
          (goto-char start)
          (error
           "(kotl-mode:add-cell): No higher level at which to add cell")))
-      ;; Skip from point past any children to next cell.
-      (when (kotl-mode:next-tree)
-       ;; If found a new tree, then move back to prior cell so can add
-       ;; new cell after it.
-       (kcell-view:previous nil lbl-sep-len)))
-    (goto-char (kcell-view:end))
+      (if (and (eq parent 0) (eq cell-level 1))
+         ;; Add as first child of hidden root cell 0, i.e. as the first
+         ;; cell in the outline
+         (goto-char (point-min))
+       ;; Add as following sibling of current cell's parent.
+       ;; Move to parent.
+       ;; Skip from point past any children to next cell.
+       (when (kotl-mode:next-tree)
+         ;; If found a new tree, then move back to prior cell so can add
+         ;; new cell after it.
+         (kcell-view:previous nil lbl-sep-len))))
+
+    (unless (eq parent 0)
+      (goto-char (kcell-view:end)))
     ;;
     ;; Insert new cells into view.
     (if (= cells-to-add 1)
@@ -2375,6 +2393,16 @@ Return last newly added cell."
     (kotl-mode:beginning-of-cell)
     new-cell))
 
+(defun kotl-mode:add-prior-cell ()
+  "Add a new cell to current kview as a prior sibling of the current cell."
+  (interactive "*")
+  (cond ((kotl-mode:backward-cell 1)
+        (kotl-mode:add-cell 1))
+       ((kotl-mode:up-level 1)
+        (kotl-mode:add-cell '(4)))
+       (t
+        (kotl-mode:add-after-parent))))
+
 (defun kotl-mode:demote-tree (arg)
   "Move current tree a maximum of prefix ARG levels lower in current view.
 Each cell is refilled iff its `no-fill' attribute is nil and
@@ -3728,7 +3756,7 @@ Leave point at end of line now residing at START."
        (define-key kotl-mode-map "\C-c\C-n"  'kotl-mode:next-cell)
        (define-key kotl-mode-map "\C-c\C-o"  'kotl-mode:overview)
        (define-key kotl-mode-map "\C-c\C-p"  'kotl-mode:previous-cell)
-       (define-key kotl-mode-map "\C-cp"     'kotl-mode:add-parent)
+       (define-key kotl-mode-map "\C-cp"     'kotl-mode:add-after-parent)
        (if (memq (global-key-binding "\M-q") '(fill-paragraph
                                                fill-paragraph-or-region))
            (progn
diff --git a/man/hyperbole.texi b/man/hyperbole.texi
index 438331af61..c0a1cc3361 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:     16-Mar-25 at 10:23:12 by Bob Weiner
+@c Last-Mod:     20-Apr-25 at 15:14:53 by Bob Weiner
 
 @c %**start of header (This is for running Texinfo on a region.)
 @setfilename hyperbole.info
@@ -30,8 +30,8 @@
 @set txicodequoteundirected
 @set txicodequotebacktick
 
-@set UPDATED March, 2025
-@set UPDATED-MONTH March 2025
+@set UPDATED April, 2025
+@set UPDATED-MONTH April 2025
 @set EDITION 9.0.2pre
 @set VERSION 9.0.2pre
 
@@ -171,7 +171,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</P>
 
 <PRE>
 Edition 9.0.2pre
-Printed March 16, 2025.
+Printed April 20, 2025.
 
   Published by the Free Software Foundation, Inc.
   Author:    Bob Weiner
@@ -213,7 +213,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 @example
 Edition 9.0.2pre
-March 16, 2025
+April 20, 2025
 
   Published by the Free Software Foundation, Inc.
   Author:    Bob Weiner
@@ -3836,7 +3836,7 @@ Mail Reader Message      link-to-mail
 Directory Name           link-to-directory
 Filename                 link-to-file
 Koutline Cell            link-to-kcell
-Outline Heading          link-to-string-match
+Outline Heading          link-to-file
 Buffer attached to File  link-to-file
 Buffer without File      link-to-buffer-tmp
 @end example
@@ -9498,6 +9498,12 @@ REFERENCE should be a cell-ref or a string containing 
"filename, cell-ref".
 See the documentation for @code{(kcell:ref-to-id)} for valid cell-ref
 formats.
 
+@findex kotl-mode:add-after-parent
+@item kotl-mode:add-after-parent  @bkbd{C-c p}
+Add a new cell to current kview after current cell's parent.
+If parent is the hidden root cell 0, then add as the first cell of the
+outline.  Otherwise, add it as the next sibling of the parent cell.
+
 @findex kotl-mode:add-cell
 @item kotl-mode:add-cell  @bkbd{C-j}
 Add a cell following current cell at optional RELATIVE-LEVEL with CONTENTS 
string.
@@ -9512,9 +9518,9 @@ Return last newly added cell.
 @item kotl-mode:add-child  @bkbd{C-c a}
 Add a new cell to current kview as first child of current cell.
 
-@findex kotl-mode:add-parent
-@item kotl-mode:add-parent  @bkbd{C-c p}
-Add a new cell to current kview as sibling of current cell's parent.
+@findex kotl-mode:add-prior-cell
+@item kotl-mode:add-prior-cell
+Add a new cell to current kview as a prior sibling of the current cell.
 
 @findex kotl-mode:append-cell
 @item kotl-mode:append-cell  @bkbd{C-c +}
diff --git a/test/demo-tests.el b/test/demo-tests.el
index 3df7483821..6d58fe16fc 100644
--- a/test/demo-tests.el
+++ b/test/demo-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <ma...@gnu.org>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:     16-Jun-24 at 18:38:13 by Mats Lidell
+;; Last-Mod:     20-Apr-25 at 14:55:17 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -811,17 +811,22 @@ enough files with matching mode loaded."
     (hy-test-helpers:kill-buffer "DEMO")))
 
 (ert-deftest fast-demo-display-kotl-starting-from-cell ()
-  "Verify a kotl file can be displayed from cell ref."
-  (unwind-protect
-      (let ((default-directory hyperb:dir))
-        (with-temp-buffer
-          (insert "<kotl/EXAMPLE.kotl#3b10|c2en>")
+  "Verify a kotl file can be displayed properly from a cell ref."
+  (let ((default-directory)
+       (buf))
+    (unwind-protect
+       (with-temp-buffer
+         (setq default-directory hyperb:dir)
+          (insert (format "<%skotl/EXAMPLE.kotl#3b10|c2en>"
+                         default-directory))
           (goto-char 5)
           (action-key)
-          (should (string= "EXAMPLE.kotl" (buffer-name)))
-          ;; FIXME: Add verification of lines per cell
-          (should (looking-at-p "Cell Transposition:"))))
-    (hy-test-helpers:kill-buffer "EXAMPLE.kotl")))
+         (setq buf (current-buffer))
+          (should (string-suffix-p "EXAMPLE.kotl" buffer-file-name))
+          (should (looking-at-p "Cell Transposition:"))
+         ;; Ensure visible cell length is cutoff at 2 lines
+         (should (= 2 (hypb:string-count-matches "\n" (kcell-view:contents)))))
+      (hy-test-helpers:kill-buffer buf))))
 
 (provide 'demo-tests)
 
diff --git a/test/hui-tests.el b/test/hui-tests.el
index 621ab0ed89..354d32b2aa 100644
--- a/test/hui-tests.el
+++ b/test/hui-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <ma...@gnu.org>
 ;;
 ;; Orig-Date:    30-Jan-21 at 12:00:00
-;; Last-Mod:      2-Feb-25 at 22:19:25 by Mats Lidell
+;; Last-Mod:     20-Apr-25 at 15:12:11 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -871,12 +871,12 @@ With point on label suggest that ibut for rename."
           (find-file filea)
           (hui:ibut-link-directly (get-buffer-window)
                                   (get-buffer-window (get-file-buffer fileb)))
-          (should (string= (buffer-string) (concat "\"" 
(file-name-nondirectory fileb) "#header:L1:C1\"")))
+          (should (string= (buffer-string) (concat "\"" 
(file-name-nondirectory fileb) "#header\"")))
           (goto-char (point-min))
           (search-forward "#")
           (action-key)
           (should (string= (buffer-name) (file-name-nondirectory fileb)))
-          (should (= (point) 2)))
+          (should (= (point) 1)))
       (hy-delete-file-and-buffer filea)
       (hy-delete-file-and-buffer fileb))))
 
@@ -1129,13 +1129,13 @@ With point on label suggest that ibut for rename."
     (mark-word)
     (hy-test-helpers:ensure-link-possible-type 'link-to-string-match))
 
-  ;; Outline Heading          link-to-string-match
+  ;; Outline Heading          link-to-file
   (let ((file (make-temp-file "hypb" nil ".otl" "* heading\nbody\n")))
     (unwind-protect
         (progn
           (find-file file)
           (goto-char 1)
-          (hy-test-helpers:ensure-link-possible-type 'link-to-string-match))
+          (hy-test-helpers:ensure-link-possible-type 'link-to-file))
       (hy-delete-file-and-buffer file)))
 
   ;; Buffer attached to File  link-to-file
diff --git a/test/kotl-mode-tests.el b/test/kotl-mode-tests.el
index 01b3bfeb55..79cae0d83f 100644
--- a/test/kotl-mode-tests.el
+++ b/test/kotl-mode-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell <ma...@gnu.org>
 ;;
 ;; Orig-Date:    18-May-21 at 22:14:10
-;; Last-Mod:     21-Mar-24 at 10:53:08 by Bob Weiner
+;; Last-Mod:     20-Apr-25 at 00:28:41 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -493,7 +493,7 @@
           (insert "1")
           (kotl-mode:add-child)
           (insert "1a")
-          (kotl-mode:add-parent)
+          (kotl-mode:add-after-parent)
           (insert "2")
 
           (kotl-mode:previous-cell 1)
@@ -515,7 +515,7 @@
           (insert "1")
           (kotl-mode:add-child)
           (insert "1a")
-          (kotl-mode:add-parent)
+          (kotl-mode:add-after-parent)
           (insert "2")
 
           (kotl-mode:previous-cell 1)
@@ -977,7 +977,7 @@ optional DEPTH the number of sub cells are created to that 
depth."
     (make-kotl-mode-tests--func :func #'klink:create :args '("1a"))
     (make-kotl-mode-tests--func :func #'kotl-mode:add-cell)
     (make-kotl-mode-tests--func :func #'kotl-mode:add-child)
-    (make-kotl-mode-tests--func :func #'kotl-mode:add-parent)
+    (make-kotl-mode-tests--func :func #'kotl-mode:add-after-parent)
     (make-kotl-mode-tests--func :func #'kotl-mode:append-cell :args '("1a" 
"1a1"))
     (make-kotl-mode-tests--func :func #'kotl-mode:back-to-indentation)
     (make-kotl-mode-tests--func :func #'kotl-mode:backward-cell :args '(1))

Reply via email to