diff options
| author | Kim F. Storm | 2002-06-14 14:00:07 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2002-06-14 14:00:07 +0000 |
| commit | dafe5452823ab1dab7793c9503effaaa6350a78e (patch) | |
| tree | 7f70391029b14b97015977a9bf7fb17858d48c1b | |
| parent | 7363941790d8c72ff83322bf5e4f327ff4d1af6e (diff) | |
| download | emacs-dafe5452823ab1dab7793c9503effaaa6350a78e.tar.gz emacs-dafe5452823ab1dab7793c9503effaaa6350a78e.zip | |
(grep-tree): Doc fixes.
Added SUBDIRS arg for non-interactive use.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/compile.el | 21 |
2 files changed, 22 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6f8eb87a388..67dbd77bacb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2002-06-14 Kim F. Storm <storm@filanet.dk> | ||
| 2 | |||
| 3 | * progmodes/compile.el (grep-tree): Doc fixes. | ||
| 4 | Added SUBDIRS arg for non-interactive use. | ||
| 5 | |||
| 1 | 2002-06-14 Juanma Barranquero <lektu@terra.es> | 6 | 2002-06-14 Juanma Barranquero <lektu@terra.es> |
| 2 | 7 | ||
| 3 | * comint.el (comint-snapshot-last-prompt): Bind | 8 | * comint.el (comint-snapshot-last-prompt): Bind |
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 7a759f1e2ef..54c5523fed1 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -860,14 +860,23 @@ easily repeat a find command." | |||
| 860 | (defvar grep-tree-last-regexp "") | 860 | (defvar grep-tree-last-regexp "") |
| 861 | (defvar grep-tree-last-files (car (car grep-tree-files-aliases))) | 861 | (defvar grep-tree-last-files (car (car grep-tree-files-aliases))) |
| 862 | 862 | ||
| 863 | (defun grep-tree (regexp files dir) | 863 | (defun grep-tree (regexp files dir &optional subdirs) |
| 864 | "Grep in directory tree with simplified prompting for search parameters. | 864 | "Grep for REGEXP in FILES in directory tree rooted at DIR. |
| 865 | Collect output in a buffer. | 865 | Collect output in a buffer. |
| 866 | Interactively, prompt separately for each search parameter. | ||
| 867 | With prefix arg, reuse previous REGEXP. | ||
| 868 | The search is limited to file names matching shell pattern FILES. | ||
| 869 | FILES may use abbreviations defined in `grep-tree-files-aliases', e.g. | ||
| 870 | entering `ch' is equivalent to `*.[ch]'. | ||
| 871 | |||
| 866 | While find runs asynchronously, you can use the \\[next-error] command | 872 | While find runs asynchronously, you can use the \\[next-error] command |
| 867 | to find the text that grep hits refer to. | 873 | to find the text that grep hits refer to. |
| 868 | 874 | ||
| 869 | This command uses a special history list for its arguments, so you can | 875 | This command uses a special history list for its arguments, so you can |
| 870 | easily repeat a find command." | 876 | easily repeat a find command. |
| 877 | |||
| 878 | When used non-interactively, optional arg SUBDIRS limits the search to | ||
| 879 | those sub directories of DIR." | ||
| 871 | (interactive | 880 | (interactive |
| 872 | (let* ((regexp | 881 | (let* ((regexp |
| 873 | (if current-prefix-arg | 882 | (if current-prefix-arg |
| @@ -896,7 +905,11 @@ easily repeat a find command." | |||
| 896 | grep-tree-command | 905 | grep-tree-command |
| 897 | (setq grep-tree-last-regexp regexp) | 906 | (setq grep-tree-last-regexp regexp) |
| 898 | (and files (concat "-name '" files "'")) | 907 | (and files (concat "-name '" files "'")) |
| 899 | nil ;; we change default-directory to dir | 908 | (if subdirs |
| 909 | (if (stringp subdirs) | ||
| 910 | subdirs | ||
| 911 | (mapconcat 'identity subdirs " ")) | ||
| 912 | nil) ;; we change default-directory to dir | ||
| 900 | (and grep-tree-ignore-CVS-directories "-path '*/CVS' -prune -o ") | 913 | (and grep-tree-ignore-CVS-directories "-path '*/CVS' -prune -o ") |
| 901 | grep-tree-ignore-case)) | 914 | grep-tree-ignore-case)) |
| 902 | (default-directory dir) | 915 | (default-directory dir) |