unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9414: Use of 'grep-find-ignored-directories' exclude files from search.
@ 2011-08-31 21:44 Oleksandr Gavenko
  2011-08-31 22:33 ` bug#9414: Fixed patch Oleksandr Gavenko
  0 siblings, 1 reply; 3+ messages in thread
From: Oleksandr Gavenko @ 2011-08-31 21:44 UTC (permalink / raw)
  To: 9414

[-- Attachment #1: Type: text/plain, Size: 823 bytes --]

GNU Emacs 23.3.1 (i386-mingw-nt6.1.7601) of 2011-03-10 on 3249CTO

If set:

   (add-to-list 'grep-find-ignored-directories "build" t)

and try search M-x rgrep in hierarchy:

   build/xxx
   src/yyy
   src/build
   build

   $ mkdir  build src;
   $ touch  build/xxx src/yyy src/build

'find' part of 'rgrep' print only (I simplify expression of 'rgrep'):

   $ find . '(' -path '*/build' -o -path '*/lib' ')' \
      -prune -o  -type f  -print
./src/yyy

Correct one is:

   $ find . '(' -type d -path '*/build' -o -path '*/lib' ')' \
      -prune -o  -type f  -print
./src/build
./src/yyy

So any dir added to 'grep-find-ignored-directories' also affected to
*regular* file names...

I previously file bug to findutils, but I am wrong:

   http://savannah.gnu.org/bugs/?34159

This is Emacs bug.

I suggest fix in patch.

[-- Attachment #2: grep-find-ignored-directories.patch --]
[-- Type: text/plain, Size: 436 bytes --]

=== modified file 'lisp/progmodes/grep.el'
--- lisp/progmodes/grep.el	2011-02-10 19:13:31 +0000
+++ lisp/progmodes/grep.el	2011-08-31 21:35:14 +0000
@@ -958,7 +958,7 @@
 		       (and grep-find-ignored-directories
 			    (concat (shell-quote-argument "(")
 				    ;; we should use shell-quote-argument here
-				    " -path "
+				    " -type d -path "
 				    (mapconcat
 				     #'(lambda (ignore)
 					 (cond ((stringp ignore)


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

* bug#9414: Fixed patch.
  2011-08-31 21:44 bug#9414: Use of 'grep-find-ignored-directories' exclude files from search Oleksandr Gavenko
@ 2011-08-31 22:33 ` Oleksandr Gavenko
  2011-09-05  9:55   ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Oleksandr Gavenko @ 2011-08-31 22:33 UTC (permalink / raw)
  To: 9414

[-- Attachment #1: Type: text/plain, Size: 112 bytes --]

Previous patch is wrong (I miss 'find' options priority).

This one right (more priestly tested and work fine).

[-- Attachment #2: grep-find-ignored-directories_2.patch --]
[-- Type: text/plain, Size: 433 bytes --]

=== modified file 'lisp/progmodes/grep.el'
--- lisp/progmodes/grep.el	2011-02-10 19:13:31 +0000
+++ lisp/progmodes/grep.el	2011-08-31 22:25:40 +0000
@@ -956,7 +956,7 @@
 		      dir
 		      (concat
 		       (and grep-find-ignored-directories
-			    (concat (shell-quote-argument "(")
+			    (concat "-type d " (shell-quote-argument "(")
 				    ;; we should use shell-quote-argument here
 				    " -path "
 				    (mapconcat


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

* bug#9414: Fixed patch.
  2011-08-31 22:33 ` bug#9414: Fixed patch Oleksandr Gavenko
@ 2011-09-05  9:55   ` Juri Linkov
  0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2011-09-05  9:55 UTC (permalink / raw)
  To: Oleksandr Gavenko; +Cc: 9414-done

> Previous patch is wrong (I miss 'find' options priority).
>
> This one right (more priestly tested and work fine).

Thank you.  This patch is now committed.





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

end of thread, other threads:[~2011-09-05  9:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-31 21:44 bug#9414: Use of 'grep-find-ignored-directories' exclude files from search Oleksandr Gavenko
2011-08-31 22:33 ` bug#9414: Fixed patch Oleksandr Gavenko
2011-09-05  9:55   ` Juri Linkov

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).