branch: externals/hyperbole
commit 64eee9b9b7b0caa9d8407ebc96391f33437f5314
Merge: a7f6199602 550d4fed2f
Author: Robert Weiner <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #812 from rswgnu/rsw
    
    Action ibtype - Remove deleting of region when in a string; hpath:at-p - 
Fix hpath:prefix-regexp handling
---
 ChangeLog                | 16 ++++++++++++++++
 hibtypes.el              | 11 +++++------
 hpath.el                 | 14 ++++++++++----
 hyrolo.el                |  3 +--
 test/hywiki-tests.el     | 11 +++++------
 test/hywiki-yki-tests.el | 12 ++++++------
 6 files changed, 43 insertions(+), 24 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6b3d64e879..4bb8ec596f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-11-16  Bob Weiner  <[email protected]>
+
+* test/hywiki-tests.el (hywiki-tests--hkey-help): Rename to
+    'hywiki-tests--hywiki-help' and stop mocking call to 'documentation'.
+
+* hpath.el (hpath:at-p): Solve problem with hpath:prefix-regexp paths where 
path
+    was expanded without stripping the prefix char.  This also led to failures 
if
+    a space was on a line before the double quoted path with prefix char, e.g.
+    SPC "!/bin/ls" or SPC "!ls".
+
 2025-11-12  Mats Lidell  <[email protected]>
 
 * test/MANIFEST: Add hywiki-yki-tests.el plus older tests missing from
@@ -11,6 +21,12 @@
     Verify that unbalanced quotes on same line as quoted path does not
     interfere with finding the path.
 
+2025-11-09  Bob Weiner  <[email protected]>
+
+* hibtypes.el (action): Remove deletion of region on Action Key press when
+    point is in a string.  Make Action Button behavior consistent independent
+    of point.
+
 2025-11-07  Mats Lidell  <[email protected]>
 
 * hsys-www.el (eww--dwim-expand-url): Declare function to silence warning.
diff --git a/hibtypes.el b/hibtypes.el
index 46b1ea444d..404c839f5e 100644
--- a/hibtypes.el
+++ b/hibtypes.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:    19-Sep-91 at 20:45:31
-;; Last-Mod:      7-Sep-25 at 17:27:58 by Bob Weiner
+;; Last-Mod:      9-Nov-25 at 13:52:10 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -1593,10 +1593,9 @@ action type, function symbol to call or test to execute, 
i.e.
 
     ;; Continue only if there if there is a button label and one of:
     ;;  1. `ert--running-tests' is non-nil
-    ;;  2.  in a string
-    ;;  3. character after start-delim is not a whitespace character
+    ;;  2. character after start-delim is not a whitespace character
     (when (and lbl-key
-              (or testing-flag (hypb:in-string-p)
+              (or testing-flag
                   (not (memq (if (char-after (1+ start-pos))
                                       (char-syntax (char-after (1+ start-pos)))
                                     0)
@@ -1665,10 +1664,10 @@ action type, function symbol to call or test to 
execute, i.e.
                                  (setq args `((,actype-sym ,start-pos
                                                            ,end-pos))))
                              (setq args `(',action))))
-                  (if (or testing-flag (hypb:in-string-p))
+                  (if testing-flag
                       ;; Delete action button after activation when
                       ;; running an ert test or in a string (so can
-                      ;; test this behavior interactively)
+                      ;; test this behavior interactively),
                       (setq actype #'display-value-and-remove-region
                             args `(,action ,start-pos ,end-pos))
                     (setq actype #'display-value
diff --git a/hpath.el b/hpath.el
index b6b1473b7f..b35da06acd 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:     26-Oct-25 at 13:15:29 by Bob Weiner
+;; Last-Mod:     16-Nov-25 at 10:49:44 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -962,14 +962,20 @@ are allowed.  Nonexistent local paths may not contain 
whitespace
 unless they are delimited.  Absolute pathnames must begin with a `/'
 or `~'."
   (let ((path (hpath:delimited-possible-path non-exist))
+       prefix
        subpath)
     (when path
       (setq path (string-trim path)))
-    (when (and path (not non-exist) (string-match hpath:prefix-regexp path)
+    (when (and path (not non-exist)
+              (string-match hpath:prefix-regexp path)
+              (setq prefix (substring path 0 1)
+                    path (substring path 1))
               (not (string-equal (match-string 0 path) path)))
       (setq non-exist t))
-    (if (and path (not (string-empty-p path)) (file-readable-p path))
-       path
+    (if (and path (not (string-empty-p path))
+            (or (and non-exist prefix)
+                (file-readable-p path)))
+       (concat prefix path)
       (unless (and path (or (string-empty-p path)
                            (string-match "::" path)))
        (cond ((and path
diff --git a/hyrolo.el b/hyrolo.el
index 48489b1fb1..32726d2720 100644
--- a/hyrolo.el
+++ b/hyrolo.el
@@ -3,7 +3,7 @@
 ;; Author:       Bob Weiner
 ;;
 ;; Orig-Date:     7-Jun-89 at 22:08:29
-;; Last-Mod:     18-Oct-25 at 11:31:47 by Bob Weiner
+;; Last-Mod:      9-Nov-25 at 13:31:08 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -2216,7 +2216,6 @@ Return number of groupings matched."
 This mode does not add any outline-related font-locking.
 
 See the command `outline-mode' for more information on this mode."
-  ;; nil " Outl" nil ;; FIXME: From when is this obsolete?
   :init-value nil
   :lighter " Outl"
   :keymap nil
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index eed39b5163..eba21113a3 100644
--- a/test/hywiki-tests.el
+++ b/test/hywiki-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell
 ;;
 ;; Orig-Date:    18-May-24 at 23:59:48
-;; Last-Mod:      2-Nov-25 at 18:54:18 by Mats Lidell
+;; Last-Mod:     16-Nov-25 at 11:09:20 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -2099,8 +2099,8 @@ face is verified during the change."
             (should (string= (hywiki-consult-grep "regexp" 1 '("path")) 
"match"))))
       (hywiki-tests--delete-hywiki-dir-and-buffer hywiki-directory))))
 
-(ert-deftest hywiki-tests--hkey-help ()
-  "Verify `hkey-help'."
+(ert-deftest hywiki-tests--hywiki-help ()
+  "Verify `hywiki-help'."
   (mocklet (((hkey-actions) => t)
             ((hkey-help) => "hkey-help"))
     (should (string= (hywiki-help) "hkey-help")))
@@ -2110,12 +2110,11 @@ face is verified during the change."
           (when (get-buffer help-bn)
             (kill-buffer help-bn))
           (mocklet (((hkey-actions) => nil)
-                    (hkey-help not-called)
-                    ((documentation 'ibtypes::hywiki-existing-word) => "Doc 
string"))
+                    (hkey-help not-called))
             (hywiki-help)
             (should (get-buffer help-bn))
             (with-current-buffer help-bn
-              (should (string= (buffer-string) "Doc string\n")))))
+              (should (string-prefix-p "On a HyWikiWord" (buffer-string))))))
       (kill-buffer help-bn))))
 
 (ert-deftest hywiki-tests--add-path-link-v2 ()
diff --git a/test/hywiki-yki-tests.el b/test/hywiki-yki-tests.el
index 938c8923e4..487b00a725 100644
--- a/test/hywiki-yki-tests.el
+++ b/test/hywiki-yki-tests.el
@@ -3,7 +3,7 @@
 ;; Author:       Mats Lidell
 ;;
 ;; Orig-Date:    13-Jul-25 at 19:50:37
-;; Last-Mod:     11-Nov-25 at 17:21:42 by Mats Lidell
+;; Last-Mod:     16-Nov-25 at 11:16:45 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -57,7 +57,7 @@ inserted.  Finally a `hywiki-test--point-char' is inserted 
where point is."
          (sorted-positions (sort zero-based-positions
                                 (lambda (a b) (> (car a) (car b)))))
          (result buffer-string))
-    
+
     ;; First, process all ranges from right to left
     (dolist (pos sorted-positions)
       (let* ((start (car pos))
@@ -65,9 +65,9 @@ inserted.  Finally a `hywiki-test--point-char' is inserted 
where point is."
              (before (substring result 0 start))
              (middle (substring result start end))
              (after (substring result end)))
-        
+
         (setq result (concat before hywiki-test--highlight-start-char middle 
hywiki-test--highlight-end-char after))))
-    
+
     ;; Then insert point char adjusting for inserted chars.
     (let* ((point-pos (1- current-point))
            (tags-before-point 0))
@@ -83,13 +83,13 @@ inserted.  Finally a `hywiki-test--point-char' is inserted 
where point is."
             (setq tags-before-point (+ tags-before-point
                                      (length hywiki-test--highlight-start-char)
                                      (length 
hywiki-test--highlight-end-char)))))))
-      
+
       ;; Insert point char at adjusted position
       (let* ((adjusted-point (+ point-pos tags-before-point))
              (before (substring result 0 adjusted-point))
              (after (substring result adjusted-point)))
         (setq result (concat before hywiki-test--point-char after))))
-    
+
     result))
 
 (ert-deftest hywiki-test--insert--test ()

Reply via email to