comparison lisp/packages/igrep.el @ 213:78f53ef88e17 r20-4b5

Import from CVS: tag r20-4b5
author cvs
date Mon, 13 Aug 2007 10:06:47 +0200
parents 8eaf7971accc
children
comparison
equal deleted inserted replaced
212:d8688acf4c5b 213:78f53ef88e17
101 ;;; (autoload (function dired-do-grep) "igrep" 101 ;;; (autoload (function dired-do-grep) "igrep"
102 ;;; "*Run `grep` on the marked (or next prefix ARG) files." t) 102 ;;; "*Run `grep` on the marked (or next prefix ARG) files." t)
103 ;;; (autoload (function dired-do-grep-find) "igrep" 103 ;;; (autoload (function dired-do-grep-find) "igrep"
104 ;;; "*Run `grep` via `find` on the marked (or next prefix ARG) directories." t) 104 ;;; "*Run `grep` via `find` on the marked (or next prefix ARG) directories." t)
105 ;;; 3. If you are running Windows 95/NT, you should install findutils 105 ;;; 3. If you are running Windows 95/NT, you should install findutils
106 ;;; and grep from release 17.1 (or higher) of the Cygnus GNU-Win32 106 ;;; and grep from release 17.1 (or higher) of the Cygnus cygwin32
107 ;;; distribution. See <URL:http://www.cygnus.com/misc/gnu-win32/>. 107 ;;; distribution. See <URL:http://www.cygnus.com/misc/gnu-win32/>.
108 108
109 ;;; Usage: 109 ;;; Usage:
110 ;;; 110 ;;;
111 ;;; M-x igrep M-x igrep-find 111 ;;; M-x igrep M-x igrep-find
327 (defalias 'grep-find 'igrep-find) 327 (defalias 'grep-find 'igrep-find)
328 (defalias 'dired-do-grep 'dired-do-igrep) 328 (defalias 'dired-do-grep 'dired-do-igrep)
329 (defalias 'dired-do-grep-find 'dired-do-igrep-find)) 329 (defalias 'dired-do-grep-find 'dired-do-igrep-find))
330 330
331 331
332 (defvar win32-quote-process-args) ; XEmacs 332 (defvar mswindows-quote-process-args) ; XEmacs
333 333
334 ;;;###autoload 334 ;;;###autoload
335 (defun igrep (program expression files &optional options) 335 (defun igrep (program expression files &optional options)
336 "*Run `grep` PROGRAM to match EXPRESSION in FILES. 336 "*Run `grep` PROGRAM to match EXPRESSION in FILES.
337 The output is displayed in the *igrep* buffer, which \\[next-error] and 337 The output is displayed in the *igrep* buffer, which \\[next-error] and
377 (setq files (list files))) 377 (setq files (list files)))
378 (if (string-match "^[rj]?sh$" (file-name-nondirectory shell-file-name)) 378 (if (string-match "^[rj]?sh$" (file-name-nondirectory shell-file-name))
379 ;; (restricted, job-control, or standard) Bourne shell doesn't expand ~: 379 ;; (restricted, job-control, or standard) Bourne shell doesn't expand ~:
380 (setq files 380 (setq files
381 (mapcar 'expand-file-name files))) 381 (mapcar 'expand-file-name files)))
382 (let* ((win32-quote-process-args nil) ; work around NT Emacs hack 382 (let* ((mswindows-quote-process-args nil) ; work around NT Emacs hack
383 (use-zgrep (cond ((eq igrep-use-zgrep t)) 383 (use-zgrep (cond ((eq igrep-use-zgrep t))
384 (igrep-use-zgrep 384 (igrep-use-zgrep
385 (let ((files files) 385 (let ((files files)
386 (compressed-p nil)) 386 (compressed-p nil))
387 (while (and files (not compressed-p)) 387 (while (and files (not compressed-p))