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

    hpath:delimited-possible-path - Fix to allow spaces only if in a str
---
 ChangeLog |  7 +++++++
 hpath.el  | 18 +++++++++++-------
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 302328610f..d213a1476a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-10-12  Bob Weiner  <[email protected]>
+
+* hpath.el (hpath:at-p): Update doc to reflect that if NON-EXIST is given, a
+    filename can have whitespace only if it is delimited.
+           (hpath:delimited-possible-path): Check for delimited strings only if
+    (hypb:in-string-p) returns non-nil.
+
 2025-10-05  Bob Weiner  <[email protected]>
 
 * hsys-www.el (eww-browse-url): Stop overloading this 'eww' function and 
replace
diff --git a/hpath.el b/hpath.el
index 104276c5d8..faaa8ae997 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:     27-Sep-25 at 18:52:18 by Bob Weiner
+;; Last-Mod:     12-Oct-25 at 12:22:05 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -958,7 +958,9 @@ quote, whitespace, or Texinfo file references.  If optional 
TYPE
 is the symbol \\='file or \\='directory, then only that path type
 is accepted as a match.  Only locally reachable paths are checked
 for existence.  With optional NON-EXIST, nonexistent local paths
-are allowed.  Absolute pathnames must begin with a `/' or `~'."
+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))
        subpath)
     (when path
@@ -1145,11 +1147,13 @@ end-pos) or nil."
                        (hargs:delimited "\\\"" "\\\"" nil nil 
include-positions "[`'’]")
                        ;; Filenames in TexInfo docs
                        (hargs:delimited "@file{" "}" nil nil include-positions)
-                       ;; Double quoted filenames
-                       (hargs:delimited "\"" "\"" nil nil include-positions 
"[`'’]")
-                       ;; Filenames in Info docs, Python files or 'ls' listing 
files in
-                       ;; single quotes
-                       (hargs:delimited "[`'‘]" "[`'’]" t t include-positions 
"\"")))
+                       (and (hypb:in-string-p)
+                            (or
+                             ;; Double quoted filenames
+                             (hargs:delimited "\"" "\"" nil nil 
include-positions "[`'’]")
+                             ;; Filenames in Info docs, Python files or 'ls' 
listing files in
+                             ;; single quotes
+                             (hargs:delimited "[`'‘]" "[`'’]" t t 
include-positions "\"")))))
           (p (if (listp triplet) (car triplet) triplet)))
       (if non-exist
          ;; This may be a triplet of (path start-pos end-pos) or just path

Reply via email to