/[emacs]/emacs/lisp/eshell/em-glob.el
ViewVC logotype

Diff of /emacs/lisp/eshell/em-glob.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by pj, Sat Feb 16 09:38:46 2002 UTC revision 1.7.4.1 by miles, Fri Apr 4 06:20:20 2003 UTC
# Line 21  Line 21 
21  ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,  ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22  ;; Boston, MA 02111-1307, USA.  ;; Boston, MA 02111-1307, USA.
23    
24    ;;; Code:
25    
26  (provide 'em-glob)  (provide 'em-glob)
27    
28  (eval-when-compile (require 'esh-maint))  (eval-when-compile (require 'esh-maint))
29    (require 'esh-util)
30    
31  (defgroup eshell-glob nil  (defgroup eshell-glob nil
32    "This module provides extended globbing syntax, similar what is used    "This module provides extended globbing syntax, similar what is used
# Line 128  This option slows down recursive glob pr Line 131  This option slows down recursive glob pr
131  (defun eshell-glob-initialize ()  (defun eshell-glob-initialize ()
132    "Initialize the extended globbing code."    "Initialize the extended globbing code."
133    ;; it's important that `eshell-glob-chars-list' come first    ;; it's important that `eshell-glob-chars-list' come first
134    (set (make-local-variable 'eshell-special-chars-outside-quoting)    (when (boundp 'eshell-special-chars-outside-quoting)
135         (append eshell-glob-chars-list eshell-special-chars-outside-quoting))      (set (make-local-variable 'eshell-special-chars-outside-quoting)
136             (append eshell-glob-chars-list eshell-special-chars-outside-quoting)))
137    (set (make-local-variable 'eshell-glob-chars-regexp)    (set (make-local-variable 'eshell-glob-chars-regexp)
138         (format "[%s]+" (apply 'string eshell-glob-chars-list)))         (format "[%s]+" (apply 'string eshell-glob-chars-list)))
139    (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t)    (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t)
# Line 228  resulting regular expression." Line 232  resulting regular expression."
232    
233  (defun eshell-extended-glob (glob)  (defun eshell-extended-glob (glob)
234    "Return a list of files generated from GLOB, perhaps looking for DIRS-ONLY.    "Return a list of files generated from GLOB, perhaps looking for DIRS-ONLY.
235   This function almost fully supports zsh style filename generation  This function almost fully supports zsh style filename generation
236   syntax.  Things that are not supported are:  syntax.  Things that are not supported are:
237    
238     ^foo        for matching everything but foo     ^foo        for matching everything but foo
239     (foo~bar)   tilde within a parenthesis group     (foo~bar)   tilde within a parenthesis group
240     foo<1-10>   numeric ranges     foo<1-10>   numeric ranges
241     foo~x(a|b)  (a|b) will be interpreted as a predicate/modifier list     foo~x(a|b)  (a|b) will be interpreted as a predicate/modifier list
242    
243   Mainly they are not supported because file matching is done with Emacs  Mainly they are not supported because file matching is done with Emacs
244   regular expressions, and these cannot support the above constructs.  regular expressions, and these cannot support the above constructs.
245    
246   If this routine fails, it returns nil.  Otherwise, it returns a list  If this routine fails, it returns nil.  Otherwise, it returns a list
247   the form:  the form:
248    
249     (INCLUDE-REGEXP EXCLUDE-REGEXP (PRED-FUNC-LIST) (MOD-FUNC-LIST))"     (INCLUDE-REGEXP EXCLUDE-REGEXP (PRED-FUNC-LIST) (MOD-FUNC-LIST))"
250    (let ((paths (eshell-split-path glob))    (let ((paths (eshell-split-path glob))
# Line 353  resulting regular expression." Line 357  resulting regular expression."
357        (eshell-glob-entries (car rdirs) globs recurse-p)        (eshell-glob-entries (car rdirs) globs recurse-p)
358        (setq rdirs (cdr rdirs)))))        (setq rdirs (cdr rdirs)))))
359    
 ;;; Code:  
   
360  ;;; em-glob.el ends here  ;;; em-glob.el ends here

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.7.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26