GNU bug report logs - #10351
24.0.92; [PATCH] rgrep prunes too much

Previous Next

Package: emacs;

Reported by: Wolfgang Jenkner <wjenkner <at> inode.at>

Date: Thu, 22 Dec 2011 19:37:02 UTC

Severity: normal

Tags: fixed, patch

Merged with 12201

Found in versions 24.0.92, 24.1

Fixed in version 24.3

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Wolfgang Jenkner <wjenkner <at> inode.at>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.92; [PATCH] rgrep prunes too much
Date: Thu, 22 Dec 2011 06:00:07 +0100
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 <at> 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





This bug report was last modified 13 years and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.