/[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.10.4.1 by handa, Fri Apr 16 12:50:15 2004 UTC revision 1.10.4.2 by miles, Mon Jun 28 07:29:41 2004 UTC
# Line 122  This option slows down recursive glob pr Line 122  This option slows down recursive glob pr
122    :type '(repeat (cons character (choice regexp function)))    :type '(repeat (cons character (choice regexp function)))
123    :group 'eshell-glob)    :group 'eshell-glob)
124    
 ;;; Internal Variables:  
   
 (defvar eshell-glob-chars-regexp nil)  
   
125  ;;; Functions:  ;;; Functions:
126    
127  (defun eshell-glob-initialize ()  (defun eshell-glob-initialize ()
# Line 134  This option slows down recursive glob pr Line 130  This option slows down recursive glob pr
130    (when (boundp 'eshell-special-chars-outside-quoting)    (when (boundp 'eshell-special-chars-outside-quoting)
131      (set (make-local-variable 'eshell-special-chars-outside-quoting)      (set (make-local-variable 'eshell-special-chars-outside-quoting)
132           (append eshell-glob-chars-list 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)))  
133    (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t)    (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t)
134    (add-hook 'eshell-pre-rewrite-command-hook    (add-hook 'eshell-pre-rewrite-command-hook
135              'eshell-no-command-globbing nil t))              'eshell-no-command-globbing nil t))
# Line 184  interpretation." Line 178  interpretation."
178                    (buffer-substring-no-properties (1- (point)) (1+ end))                    (buffer-substring-no-properties (1- (point)) (1+ end))
179                  (goto-char (1+ end))))))))))                  (goto-char (1+ end))))))))))
180    
181    (defvar eshell-glob-chars-regexp nil)
182    
183  (defun eshell-glob-regexp (pattern)  (defun eshell-glob-regexp (pattern)
184    "Convert glob-pattern PATTERN to a regular expression.    "Convert glob-pattern PATTERN to a regular expression.
185  The basic syntax is:  The basic syntax is:
# Line 204  set to true, then these characters will Line 200  set to true, then these characters will
200  resulting regular expression."  resulting regular expression."
201    (let ((matched-in-pattern 0)          ; How much of PATTERN handled    (let ((matched-in-pattern 0)          ; How much of PATTERN handled
202          regexp)          regexp)
203      (while (string-match eshell-glob-chars-regexp      (while (string-match
204                           pattern matched-in-pattern)              (or eshell-glob-chars-regexp
205                    (set (make-local-variable 'eshell-glob-chars-regexp)
206                         (format "[%s]+" (apply 'string eshell-glob-chars-list))))
207                pattern matched-in-pattern)
208        (let* ((op-begin (match-beginning 0))        (let* ((op-begin (match-beginning 0))
209               (op-char (aref pattern op-begin)))               (op-char (aref pattern op-begin)))
210          (setq regexp          (setq regexp

Legend:
Removed from v.1.10.4.1  
changed lines
  Added in v.1.10.4.2

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