unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10351: 24.0.92; [PATCH] rgrep prunes too much
@ 2011-12-22  5:00 Wolfgang Jenkner
  2011-12-22 21:05 ` Juri Linkov
  2012-04-11 11:41 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Wolfgang Jenkner @ 2011-12-22  5:00 UTC (permalink / raw)
  To: 10351

In the shell, type:

$ rm -rf /tmp/foo/
$ mkdir -p /tmp/foo/usr.bin
$ echo xxx >/tmp/foo/bad.bin
$ echo xxx >/tmp/foo/usr.bin/good

Now, in emacs -Q, rgrep /tmp/foo for `xxx':

M-x r g r e p <return> x x x <return> <return> / t m p / f o o <return>

It will report "Grep finished with no matches found".

However, I expect it to find the match in /tmp/foo/usr.bin/good because
the way the defcustom of grep-find-ignored-files computes the default
value clearly shows that it is not meant to exclude directories.

(By the way, the FreeBSD base system source directory actually contains
a usr.bin sub-directory.)

See also bug#9414.  For a somewhat different proposal, Colin Fraizer's
message in bug#6665, but see Andreas Schwab's response.

2011-12-20  Wolfgang Jenkner  <wjenkner@inode.at>

	* lisp/progmodes/grep.el (rgrep): Tweak the find command line so
	that directories matching `grep-find-ignored-files' won't be
	pruned.


=== modified file 'lisp/progmodes/grep.el'
--- lisp/progmodes/grep.el	2011-12-12 05:32:49 +0000
+++ lisp/progmodes/grep.el	2011-12-20 20:40:02 +0000
@@ -1018,7 +1018,8 @@
 				    (shell-quote-argument ")")
 				    " -prune -o "))
 		       (and grep-find-ignored-files
-			    (concat (shell-quote-argument "(")
+			    (concat (shell-quote-argument "!") " -type d "
+				    (shell-quote-argument "(")
 				    ;; we should use shell-quote-argument here
 				    " -name "
 				    (mapconcat






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-04-11 17:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-22  5:00 bug#10351: 24.0.92; [PATCH] rgrep prunes too much Wolfgang Jenkner
2011-12-22 21:05 ` Juri Linkov
2012-04-11 11:41 ` Lars Magne Ingebrigtsen
2012-04-11 16:39   ` Glenn Morris
2012-04-11 16:52     ` Wolfgang Jenkner
2012-04-11 17:56       ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).