diff options
| author | Sam Steingold | 2009-07-08 14:23:57 +0000 |
|---|---|---|
| committer | Sam Steingold | 2009-07-08 14:23:57 +0000 |
| commit | 49405d0e1be811957433cb0c89a2fbe099fcf5b9 (patch) | |
| tree | 3d06b0e8d46a4a4e3601bfe27c6081cd6f596ef7 | |
| parent | c1d5ce9488bba9b3bc2b1dffe5e3615a409c4854 (diff) | |
| download | emacs-49405d0e1be811957433cb0c89a2fbe099fcf5b9.tar.gz emacs-49405d0e1be811957433cb0c89a2fbe099fcf5b9.zip | |
(rgrep): Allow grep-find-ignored-directories
to be a cons cell (test . ignored-directory) to selectively ignore
some directories depending on the location of the search.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/grep.el | 21 |
2 files changed, 21 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b7168fffd3a..80e6d190553 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-07-08 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/grep.el (rgrep): Allow grep-find-ignored-directories | ||
| 4 | to be a cons cell (test . ignored-directory) to selectively ignore | ||
| 5 | some directories depending on the location of the search. | ||
| 6 | |||
| 1 | 2009-07-08 Michael Albinus <michael.albinus@gmx.de> | 7 | 2009-07-08 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 8 | ||
| 3 | * net/tramp.el (tramp-set-file-uid-gid): Handle the case the | 9 | * net/tramp.el (tramp-set-file-uid-gid): Handle the case the |
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 2c70c61c32a..241a5325a1c 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -194,7 +194,9 @@ Customize or call the function `grep-apply-setting'." | |||
| 194 | 194 | ||
| 195 | (defcustom grep-find-ignored-directories | 195 | (defcustom grep-find-ignored-directories |
| 196 | vc-directory-exclusion-list | 196 | vc-directory-exclusion-list |
| 197 | "*List of names of sub-directories which `rgrep' shall not recurse into." | 197 | "*List of names of sub-directories which `rgrep' shall not recurse into. |
| 198 | If an element is a cons cell, the car is called on the search directory | ||
| 199 | to determine whether cdr should not be recursed into." | ||
| 198 | :type '(repeat string) | 200 | :type '(repeat string) |
| 199 | :group 'grep) | 201 | :group 'grep) |
| 200 | 202 | ||
| @@ -891,11 +893,18 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]." | |||
| 891 | (concat (shell-quote-argument "(") | 893 | (concat (shell-quote-argument "(") |
| 892 | ;; we should use shell-quote-argument here | 894 | ;; we should use shell-quote-argument here |
| 893 | " -path " | 895 | " -path " |
| 894 | (mapconcat #'(lambda (dir) | 896 | (mapconcat |
| 895 | (shell-quote-argument | 897 | #'(lambda (ignore) |
| 896 | (concat "*/" dir))) | 898 | (cond ((stringp ignore) |
| 897 | grep-find-ignored-directories | 899 | (shell-quote-argument |
| 898 | " -o -path ") | 900 | (concat "*/" ignore))) |
| 901 | ((consp ignore) | ||
| 902 | (and (funcall (car ignore) dir) | ||
| 903 | (shell-quote-argument | ||
| 904 | (concat "*/" | ||
| 905 | (cdr ignore))))))) | ||
| 906 | grep-find-ignored-directories | ||
| 907 | " -o -path ") | ||
| 899 | " " | 908 | " " |
| 900 | (shell-quote-argument ")") | 909 | (shell-quote-argument ")") |
| 901 | " -prune -o "))))) | 910 | " -prune -o "))))) |