unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* how to recursively grep
@ 2012-08-21  3:23 rusi
  2012-08-21  8:14 ` Peter Dyballa
       [not found] ` <mailman.7331.1345536887.855.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 4+ messages in thread
From: rusi @ 2012-08-21  3:23 UTC (permalink / raw)
  To: help-gnu-emacs

I am trying to figure out how to search source trees effectively for
identifiers.
For example I am searching for charset-map-path in the elisp directory
tree

I do
M-x zrgrep
charset-map-path  ;; string searched
... in files: I leave the default as *.gz
Base directory: /usr/share/emacs/23.4/lisp/


-*- mode: grep; default-directory: "/usr/share/emacs/23.4/lisp/" -*-
Grep started at Tue Aug 21 08:35:08

find . \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/
MCVS -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path
\*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \) -
prune -o \( -name .\#\* -o -name \*.o -o -name \*\~ -o -name \*.bin -o
-name \*.lbin -o -name \*.so -o -name \*.a -o -name \*.ln -o -name
\*.blg -o -name \*.bbl -o -name \*.elc -o -name \*.lof -o -name \*.glo
-o -name \*.idx -o -name \*.lot -o -name \*.fmt -o -name \*.tfm -o -
name \*.class -o -name \*.fas -o -name \*.lib -o -name \*.mem -o -name
\*.x86f -o -name \*.sparcf -o -name \*.fasl -o -name \*.ufsl -o -name
\*.fsl -o -name \*.dxl -o -name \*.pfsl -o -name \*.dfsl -o -name
\*.p64fsl -o -name \*.d64fsl -o -name \*.dx64fsl -o -name \*.lo -o -
name \*.la -o -name \*.gmo -o -name \*.mo -o -name \*.toc -o -name
\*.aux -o -name \*.cp -o -name \*.fn -o -name \*.ky -o -name \*.pg -o -
name \*.tp -o -name \*.vr -o -name \*.cps -o -name \*.fns -o -name
\*.kys -o -name \*.pgs -o -name \*.tps -o -name \*.vrs -o -name \*.pyc
-o -name \*.pyo \) -prune -o  -type f \( -name \*.gz \) -print0 |
"xargs" -0 -e zgrep -i -nH -e charset-map-path
./cus-start.el.gz:106:	     (charset-map-path installation

Grep exited abnormally with code 123 at Tue Aug 21 08:35:29

So it found the occurrence in cus-start.el and stopped abnormally.
Run it a second time and it does finds nothing.

What am I doing wrong?


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

* Re: how to recursively grep
  2012-08-21  3:23 how to recursively grep rusi
@ 2012-08-21  8:14 ` Peter Dyballa
       [not found] ` <mailman.7331.1345536887.855.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2012-08-21  8:14 UTC (permalink / raw)
  To: rusi; +Cc: help-gnu-emacs


Am 21.08.2012 um 05:23 schrieb rusi:

> What am I doing wrong?

Are you searching at all? Your pages long find command seems to just exclude instead of searching…

In which files do you think the string "charset-map-path" will occur? Then search for these files only:

	M-x find-grep RET
	<insert the search string at the cursor position>
	<insert '-name "*.el.gz ' appropriately>
	<adjust where the search will start, if needed>
	<adjust the grep command to deal with compressed files>
	RET

It also works to search in C source files with '-name "*.[ch]"'.

--
Greetings

  Pete

The most exciting phrase to hear in science, the one that heralds new discoveries, is not "Eureka!" (I found it!) but "That's funny..."
				– Isaac Asimov




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

* Re: how to recursively grep
       [not found] ` <mailman.7331.1345536887.855.help-gnu-emacs@gnu.org>
@ 2012-08-21 12:47   ` rusi
  2012-08-21 13:46     ` Peter Dyballa
  0 siblings, 1 reply; 4+ messages in thread
From: rusi @ 2012-08-21 12:47 UTC (permalink / raw)
  To: help-gnu-emacs

On Aug 21, 1:14 pm, Peter Dyballa <Peter_Dyba...@Web.DE> wrote:
> Am 21.08.2012 um 05:23 schrieb rusi:
>
> > What am I doing wrong?
>
> Are you searching at all? Your pages long find command seems to just exclude instead of searching…
>
> In which files do you think the string "charset-map-path" will occur? Then search for these files only:
>
>         M-x find-grep RET
>         <insert the search string at the cursor position>
>         <insert '-name "*.el.gz ' appropriately>
>         <adjust where the search will start, if needed>
>         <adjust the grep command to deal with compressed files>
>         RET
>
> It also works to search in C source files with '-name "*.[ch]"'.


So you are saying dont use zrgrep but use find-grep?


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

* Re: how to recursively grep
  2012-08-21 12:47   ` rusi
@ 2012-08-21 13:46     ` Peter Dyballa
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Dyballa @ 2012-08-21 13:46 UTC (permalink / raw)
  To: rusi; +Cc: help-gnu-emacs


Am 21.08.2012 um 14:47 schrieb rusi:

> So you are saying dont use zrgrep but use find-grep?

Yes, I feel better when I can control things. (Maybe I am also missing enough compressed files.) Both functions are in grep.el.

--
Greetings

  Pete

With Capitalism man exploits man. With communism it's the exact opposite.




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

end of thread, other threads:[~2012-08-21 13:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-21  3:23 how to recursively grep rusi
2012-08-21  8:14 ` Peter Dyballa
     [not found] ` <mailman.7331.1345536887.855.help-gnu-emacs@gnu.org>
2012-08-21 12:47   ` rusi
2012-08-21 13:46     ` Peter Dyballa

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