Function: eshell-glob-convert
eshell-glob-convert is a byte-compiled function defined in
em-glob.el.gz.
Signature
(eshell-glob-convert GLOB)
Documentation
Convert an Eshell glob-pattern GLOB to regexps.
The result is a list of three elements:
1. The base directory to search in.
2. A list containing elements of the following forms:
* Regexp pairs as generated by eshell-glob-convert-1.
* recurse, indicating that searches should recurse into
subdirectories.
* recurse-symlink, like recurse, but also following
symlinks.
3. A boolean indicating whether to match directories only.
Source Code
;; Defined in /usr/src/emacs/lisp/eshell/em-glob.el.gz
(defun eshell-glob-convert (glob)
"Convert an Eshell glob-pattern GLOB to regexps.
The result is a list of three elements:
1. The base directory to search in.
2. A list containing elements of the following forms:
* Regexp pairs as generated by `eshell-glob-convert-1'.
* `recurse', indicating that searches should recurse into
subdirectories.
* `recurse-symlink', like `recurse', but also following
symlinks.
3. A boolean indicating whether to match directories only."
(let ((globs (eshell-split-path glob))
(isdir (eq (aref glob (1- (length glob))) ?/))
start-dir result last-saw-recursion)
(if (and (cdr globs)
(file-name-absolute-p (car globs)))
(setq start-dir (car globs)
globs (cdr globs))
(setq start-dir "."))
(while globs
(if-let ((recurse (cdr (assoc (car globs)
eshell-glob-recursive-alist))))
(if last-saw-recursion
(setcar result recurse)
(push recurse result)
(setq last-saw-recursion t))
(push (eshell-glob-convert-1 (car globs) (null (cdr globs)))
result)
(setq last-saw-recursion nil))
(setq globs (cdr globs)))
(list (file-name-as-directory start-dir)
(nreverse result)
isdir)))