Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hpath:expand-list - Fix to expand a dir when 'exists-flag' is t #501

Merged
merged 3 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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