branch: externals/hyperbole
commit ef7a8355e1909d5a23fe783dd1e87ce7ed1605dc
Author: bw <r...@gnu.org>
Commit: bw <r...@gnu.org>

    hyrolo-expand-path-list - Fix to always include a default file name
---
 ChangeLog |  3 +++
 hyrolo.el | 20 +++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2190b30c43..5c1393f608 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2025-02-19  Bob Weiner  <r...@gnu.org>
 
+* hyrolo.el (hyrolo-expand-path-list): Fix to include a default file name
+    even when the file does not yet exist.
+
 * test/hyrolo-tests.el (hyrolo-test--expand-path-list): Expand matching
     filename.
 
diff --git a/hyrolo.el b/hyrolo.el
index de2768dd8c..f53dfbfc88 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:     19-Feb-25 at 20:51:38 by Bob Weiner
+;; Last-Mod:     19-Feb-25 at 21:30:51 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -674,15 +674,17 @@ they contain that match `hyrolo-file-suffix-regexp'.  
Then, if
 `find-file-wildcards' is non-nil (the default), any files
 containing [char-matches] or * wildcards are expanded to their
 matches."
-  (unless paths
-    (setq paths
-         (delq nil
-               (list (if (file-readable-p "~/.rolo.org")
+  (let ((default-file (if (file-readable-p "~/.rolo.org")
                          "~/.rolo.org"
-                       "~/.rolo.otl")
-                     (if (and (boundp 'bbdb-file) (stringp bbdb-file)) 
bbdb-file)
-                     (when (hyrolo-google-contacts-p) 
google-contacts-buffer-name)))))
-  (hpath:expand-list paths hyrolo-file-suffix-regexp #'file-readable-p))
+                       "~/.rolo.otl")))
+    (unless paths
+      (setq paths
+           (delq nil
+                 (list default-file
+                       (if (and (boundp 'bbdb-file) (stringp bbdb-file)) 
bbdb-file)
+                       (when (hyrolo-google-contacts-p) 
google-contacts-buffer-name)))))
+    (or (hpath:expand-list paths hyrolo-file-suffix-regexp #'file-readable-p)
+       (hpath:expand-list (list default-file) hyrolo-file-suffix-regexp))))
 
 ;;;###autoload
 (defun hyrolo-fgrep (string &optional max-matches hyrolo-file count-only 
headline-only no-display)

Reply via email to