Changeset 4079 for trunk/lisp/progmodes/grep.el
- Timestamp:
- 05/13/06 11:31:18 (3 years ago)
- Files:
-
- trunk/lisp/progmodes/grep.el (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lisp/progmodes/grep.el
r4073 r4079 640 640 entering `ch' is equivalent to `*.[ch]'. 641 641 642 With \\[universal-argument] prefix, allow user to edit the constructed643 shell command linebefore it is executed.644 With two \\[universal-argument] prefixes, edit and run grep shell command.642 With \\[universal-argument] prefix, you can edit the constructed shell command line 643 before it is executed. 644 With two \\[universal-argument] prefixes, directly edit and run `grep-command'. 645 645 646 646 Collect output in a buffer. While grep runs asynchronously, you … … 677 677 (read-from-minibuffer "Confirm: " 678 678 command nil nil 'grep-history)) 679 ( push command grep-history))))679 (add-to-history 'grep-history command)))) 680 680 (when command 681 681 ;; Setting process-setup-function makes exit-message-function work … … 688 688 ;;;###autoload 689 689 (defun rgrep (regexp &optional files dir) 690 "Recu sively grep for REGEXP in FILES in directory tree rooted at DIR.690 "Recursively grep for REGEXP in FILES in directory tree rooted at DIR. 691 691 The search is limited to file names matching shell pattern FILES. 692 692 FILES may use abbreviations defined in `grep-files-aliases', e.g. 693 693 entering `ch' is equivalent to `*.[ch]'. 694 694 695 With \\[universal-argument] prefix, allow user to edit the constructed696 shell command linebefore it is executed.697 With two \\[universal-argument] prefixes, edit and run grep-find shell command.695 With \\[universal-argument] prefix, you can edit the constructed shell command line 696 before it is executed. 697 With two \\[universal-argument] prefixes, directly edit and run `grep-find-command'. 698 698 699 699 Collect output in a buffer. While find runs asynchronously, you … … 722 722 (if (not (string= regexp grep-find-command)) 723 723 (compilation-start regexp 'grep-mode)) 724 ( let* ((default-directory(file-name-as-directory (expand-file-name dir)))725 (command (grep-expand-template726 grep-find-template727 regexp728 (concat "\\( -name "729 (mapconcat #'shell-quote-argument730 (split-string files)731 " -o -name ")732 " \\)")733 d efault-directory724 (setq dir (file-name-as-directory (expand-file-name dir))) 725 (let ((command (grep-expand-template 726 grep-find-template 727 regexp 728 (concat "\\( -name " 729 (mapconcat #'shell-quote-argument 730 (split-string files) 731 " -o -name ") 732 " \\)") 733 dir 734 734 (and grep-find-ignored-directories 735 735 (concat "\\( -path '*/" … … 743 743 (read-from-minibuffer "Confirm: " 744 744 command nil nil 'grep-find-history)) 745 (push command grep-find-history)) 746 (compilation-start command 'grep-mode)))))) 745 (add-to-history 'grep-find-history command)) 746 (let ((default-directory dir)) 747 (compilation-start command 'grep-mode)) 748 ;; Set default-directory if we started rgrep in the *grep* buffer. 749 (if (eq next-error-last-buffer (current-buffer)) 750 (setq default-directory dir))))))) 747 751 748 752
