changeset 48210:eeded772a8a2

Require esh-util. (eshell-glob-initialize): Don't assume eshell-special-chars-outside-quoting is available.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 07 Nov 2002 23:00:32 +0000
parents eb57ed5ddc1d
children e23f9344f37d
files lisp/eshell/em-glob.el
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/eshell/em-glob.el	Thu Nov 07 22:51:28 2002 +0000
+++ b/lisp/eshell/em-glob.el	Thu Nov 07 23:00:32 2002 +0000
@@ -21,9 +21,12 @@
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
+;;; Code:
+
 (provide 'em-glob)
 
 (eval-when-compile (require 'esh-maint))
+(require 'esh-util)
 
 (defgroup eshell-glob nil
   "This module provides extended globbing syntax, similar what is used
@@ -128,8 +131,9 @@
 (defun eshell-glob-initialize ()
   "Initialize the extended globbing code."
   ;; it's important that `eshell-glob-chars-list' come first
-  (set (make-local-variable 'eshell-special-chars-outside-quoting)
-       (append eshell-glob-chars-list eshell-special-chars-outside-quoting))
+  (when (boundp 'eshell-special-chars-outside-quoting)
+    (set (make-local-variable 'eshell-special-chars-outside-quoting)
+	 (append eshell-glob-chars-list eshell-special-chars-outside-quoting)))
   (set (make-local-variable 'eshell-glob-chars-regexp)
        (format "[%s]+" (apply 'string eshell-glob-chars-list)))
   (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t)
@@ -228,19 +232,19 @@
 
 (defun eshell-extended-glob (glob)
   "Return a list of files generated from GLOB, perhaps looking for DIRS-ONLY.
- This function almost fully supports zsh style filename generation
- syntax.  Things that are not supported are:
+This function almost fully supports zsh style filename generation
+syntax.  Things that are not supported are:
 
    ^foo        for matching everything but foo
    (foo~bar)   tilde within a parenthesis group
    foo<1-10>   numeric ranges
    foo~x(a|b)  (a|b) will be interpreted as a predicate/modifier list
 
- Mainly they are not supported because file matching is done with Emacs
- regular expressions, and these cannot support the above constructs.
+Mainly they are not supported because file matching is done with Emacs
+regular expressions, and these cannot support the above constructs.
 
- If this routine fails, it returns nil.  Otherwise, it returns a list
- the form:
+If this routine fails, it returns nil.  Otherwise, it returns a list
+the form:
 
    (INCLUDE-REGEXP EXCLUDE-REGEXP (PRED-FUNC-LIST) (MOD-FUNC-LIST))"
   (let ((paths (eshell-split-path glob))
@@ -353,6 +357,4 @@
       (eshell-glob-entries (car rdirs) globs recurse-p)
       (setq rdirs (cdr rdirs)))))
 
-;;; Code:
-
 ;;; em-glob.el ends here