Skip to content

Commit

Permalink
Merge pull request #501 from rswgnu/rsw
Browse files Browse the repository at this point in the history
hpath:expand-list - Fix to expand a dir when 'exists-flag' is t
  • Loading branch information
rswgnu committed Mar 31, 2024
2 parents e009e24 + f8e3031 commit cea3016
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-03-31 Bob Weiner <rsw@gnu.org>

* hpath.el (hpath:expand-list): Fix to properly expand a dir when 'exists-flag' is t.

2024-03-30 Bob Weiner <rsw@gnu.org>

* hyrolo.el (hyrolo-highlight-matches): Limit search to within 'end' bound.
Expand Down
9 changes: 6 additions & 3 deletions hpath.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 1-Nov-91 at 00:44:23
;; Last-Mod: 27-Mar-24 at 20:22:55 by Mats Lidell
;; Last-Mod: 31-Mar-24 at 00:23:02 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -1274,12 +1274,15 @@ ${variable} per path."
(setq path (hpath:expand path exists-flag))
(when (setq path (or (when (and path find-file-wildcards)
(file-expand-wildcards path))
(unless exists-flag (list path))))
(if exists-flag
(when (and path (file-exists-p path))
(list path))
(list path))))
(if (= (length path) 1)
(setq path (car path))
(setq paths (nconc (cdr path) paths)
path (car path)))
(if (file-directory-p path)
(if (and path (file-directory-p path))
(directory-files-recursively path (or match-regexp ""))
(list path))))
(seq-filter #'stringp paths)))
Expand Down
19 changes: 10 additions & 9 deletions hyrolo.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 7-Jun-89 at 22:08:29
;; Last-Mod: 30-Mar-24 at 13:40:27 by Bob Weiner
;; Last-Mod: 30-Mar-24 at 23:51:18 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -665,13 +665,13 @@ non-nil skips retrieval of matching entries. Optional HEADLINE-ONLY searches
only the first line of entries, not the full text. Optional NO-DISPLAY non-nil
retrieves entries but does not display them.
Nil value of MAX-MATCHES means find all matches, t value means find all
matches but omit file headers, negative values mean find up to the inverse of
that number of entries and omit file headers.
Nil value of MAX-MATCHES means find all entries that match, t value means find
all matching entries but omit file headers, negative values mean find up to the
inverse of that number of matching entries and omit file headers.
Return number of entries matched. See also documentation for the variable
`hyrolo-file-list' and the function `hyrolo-fgrep-logical' for documentation on
the logical sexpression matching."
`hyrolo-file-list' and the function `hyrolo-fgrep-logical' for documentation
on the logical sexpression matching."
(interactive "sFind rolo string (or logical sexpression): \nP")
(setq string (string-trim string "\"" "\""))
(let ((total-matches 0))
Expand Down Expand Up @@ -769,9 +769,9 @@ HEADLINE-ONLY searches only the first line of entries, not the
full text. Optional NO-DISPLAY non-nil retrieves entries but
does not display.
Nil value of MAX-MATCHES means find all matches, t value means find all matches
but omit file headers, negative values mean find up to the inverse of that
number of entries and omit file headers.
Nil value of MAX-MATCHES means find all entries that match, t value means find
all matching entries but omit file headers, negative values mean find up to the
inverse of that number of matching entries and omit file headers.
Return number of entries matched. See also documentation for the variable
\`hyrolo-file-list'."
Expand Down Expand Up @@ -1947,6 +1947,7 @@ Retrieve a maximum of optional MAX-MATCHES. Nil value of
MAX-MATCHES means find all matches, t value means find all
matches but omit file headers, negative values mean find up to
the inverse of that number of entries and omit file headers.
Optional COUNT-ONLY non-nil skips display of matching entries.
Optional HEADLINE-ONLY non-nil searches only the first line of
entries, rather than the full text.
Expand Down

0 comments on commit cea3016

Please sign in to comment.