Re: [cssed-devel] cssed-findinfiles-plugin: some problems
Brought to you by:
iagorubio
From: Iago R. <iag...@hi...> - 2004-09-14 08:10:39
|
On Mon, 2004-09-13 at 21:39, Mich=C3=A8le Garoche wrote: > Le 13 sept. 2004, =C3=A0 15:08, Iago Rubio a =C3=A9crit : [snip] > > The behaviour will be (?): > > > > 1.- if no text selection, when clicked "In file's base dir", change > > just the base directory and avoid to start the search. > > > > 2.- if no text selection, when clicked "In file's base dir", change=20 > > the > > base directory and search for the current search term. > 2 is better since it allows the user to search for a term in the active=20 > document without the need to first either type the word in the file and=20 > select it or search for the word and select (which is kind of weird=20 > when the plugin claims precisely to be a search plugin :-). Will go for it then. > Besides, it will be a nice plus: you can search by selecting a word or=20 > by entering a word in the search field, very useful when you want to be=20 > sure that a term does not exist in a file for example. You can do it right now. If you can't do it, it's a bug. Just type something in the search term entry and click "Find". [snip] > >> And precisely in WasonDesktop, there are a bunch of files containing > >> "cssed", which was the search term. > >> After investigating more, the problem raises when encountering a file > >> with a space in it, very frequent on Mac. > > > > Ah! I see now. It can be easily solved. I will test an approach. > > > > Could you please try this command line to test if it correnctly handles > > file names with embeded spaces ? > > > > find /path/to/find -print0 -type f | xargs -0 grep -n search_term > I have to cancel the find, it does not end. > Plus it searches in all files, all depth. It's the intended behaviour of find. If you don't set maxdepth it will find recursively in all subfolders. =20 Setting maxdepth it should work. > > Quick explaination: 'find -print0' will null terminate the file names, > > 'xargs -0' will search for the null character to get the end of file's > > name. > > I think it should work even with carriage return embeded file names. > That's not a carriage return (it is not an authorized character), it is=20 > a space (code 32). Yes :) , what I meant is it will work with any file name (even weirdest ones). > > Test fix in CVS. > > Patch attached. > I've not integrated it since it freezes completely find on the command=20 > line. Does this command line freezes find (in a shell) ? find `pwd` -print0 -type f -maxdepth 1 | xargs -0 grep -n term --=20 Iago Rubio =20 - Home page * http://www.iagorubio.com=20 - Last project * http://cssed.sourceforge.net =20 - GPG Keyserv * pgp.rediris.es id=3D0x909BD4DD |