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

    hyrolo.el - Return default hyrolo file if none set
    
    Fixes gh#rswgnu/hyperbole/672 and Emacs bug#76424.
---
 ChangeLog |  7 +++++++
 hyrolo.el | 22 ++++++++++++----------
 2 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 51e731c4f8..9911a9707b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-02-19  Bob Weiner  <r...@gnu.org>
+
+* hyrolo.el (hyrolo-expand-path-list): Use default "~/.rolo.org" when it
+    exists and is readable.  Fixes gh#rswgnu/hyperbole/672 and bug#76424.
+            (hyrolo-get-file-list): Return a default rolo file when `hyrolo-
+    file-list' is nil.
+
 2025-02-08  Mats Lidell  <ma...@gnu.org>
 
 * hywiki.el (hywiki--sitemap-file): Helper function for getting the sitemap
diff --git a/hyrolo.el b/hyrolo.el
index 1a11b3670e..de2768dd8c 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-Jan-25 at 22:45:52 by Bob Weiner
+;; Last-Mod:     19-Feb-25 at 20:51:38 by Bob Weiner
 ;;
 ;; SPDX-License-Identifier: GPL-3.0-or-later
 ;;
@@ -317,8 +317,6 @@ of the match or nil when no match.")
 
 (defvar hproperty:highlight-face)
 
-;; '("~/.rolo.otl" "~/.rolo.org")
-
 (defcustom hyrolo-highlight-face 'match
   "Face used to highlight rolo search matches."
   :type 'face
@@ -676,12 +674,15 @@ 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."
-  (if paths
-      (hpath:expand-list paths hyrolo-file-suffix-regexp #'file-readable-p)
-    (delq nil
-         (list "~/.rolo.otl"
-               (if (and (boundp 'bbdb-file) (stringp bbdb-file)) bbdb-file)
-               (when (hyrolo-google-contacts-p) 
google-contacts-buffer-name)))))
+  (unless paths
+    (setq paths
+         (delq nil
+               (list (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))
 
 ;;;###autoload
 (defun hyrolo-fgrep (string &optional max-matches hyrolo-file count-only 
headline-only no-display)
@@ -782,7 +783,8 @@ If ARG is zero, move to the beginning of the current line."
 (defun hyrolo-get-file-list ()
   "Return the current expanded list of HyRolo search files."
   (if (equal hyrolo-file-list (symbol-value 'hyrolo-file-list))
-      (or hyrolo--expanded-file-list hyrolo-file-list)
+      (or hyrolo--expanded-file-list hyrolo-file-list
+         (hyrolo-expand-path-list nil))
     ;; lexical-binding is enabled and there is a local binding of
     ;; `hyrolo-file-list', so expand it.
     (hyrolo-expand-path-list hyrolo-file-list)))

Reply via email to