RE: CONTRIB: recursive search in files of the current JDE project

2001-04-05 Thread Berche, Guillaume

joel, 

Oups, sorry about that, I had not restarted by emacs since I tested it and so the 
default value of the jde-grep-file-regexp variable was never reassigned. I quoted it, 
I hope it works better now. I learned one more "always test your stuff from a fresh 
emacs process" :-)

Here is the updated version, let me know if this works for you.

Thanks for your feedback,

Guillaume.


> -Original Message-
> From: Joel Metelius [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 5:18 PM
> To: Berche, Guillaume
> Subject: RE: CONTRIB: recursive search in files of the current JDE
> project 
> 
> 
> I have had the debug-on-error set to true all the time, but I 
> don't get
> a trace from this error...
> 
> sorry,
> 
> joel
> 
> > -Original Message-
> > From: Berche, Guillaume [mailto:[EMAIL PROTECTED]]
> > Sent: den 5 april 2001 17:06
> > To: Joel Metelius
> > Subject: RE: CONTRIB: recursive search in files of the current JDE
> > project 
> > 
> > 
> > Hum... I'm sorry to read this. I'm lacking a stack trace to 
> > debug this problem as it does not appear on my machine.
> > 
> > Could you please add the following statement before the 
> > load-file so that emacs dumps a stack trace:
> > (setq debug-on-error t)
> > 
> > elisp intro provides more info about this at:
> > http://www.gnu.org/manual/emacs-lisp-intro/html_chapter/emacs-
> > lisp-intro_18.html#SEC196
> > 
> > Regards,
> > 
> > Guillaume.
> > 
> > 
> > > -Original Message-
> > > From: Joel Metelius [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, April 05, 2001 4:53 PM
> > > To: Berche, Guillaume
> > > Subject: RE: CONTRIB: recursive search in files of the current JDE
> > > project 
> > > 
> > > 
> > > Same error...
> > > 
> > > Loading c:/prog/home/emacs/site/lisp/jde-grep.el (source)...
> > > Error in init file: Invalid function: "*.java"
> > > Loading cl-seq...
> > > Loading cl-seq...done
> > > File mode specification error: (invalid-function "*.java")
> > > 
> > > > -Original Message-
> > > > From: Berche, Guillaume [mailto:[EMAIL PROTECTED]]
> > > > Sent: den 5 april 2001 13:22
> > > > To: Joel Metelius
> > > > Subject: RE: CONTRIB: recursive search in files of the 
> current JDE
> > > > project 
> > > > 
> > > > 
> > > > Joel,
> > > > 
> > > > Can you try it using 
> > > > 
> > > > (load-file "/jde-grep.el") instead of (require 
> > > > 'jde-grep)
> > > > 
> > > > I did not declare this as a feature so I'm not sure that 
> > > > "require" would work. Tell me if this solves your problem.
> > > > 
> > > > Thanks,
> > > > 
> > > > Guillaume.
> > > > 
> > > > 
> > > > > -Original Message-
> > > > > From: Joel Metelius [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Thursday, April 05, 2001 12:55 PM
> > > > > To: Guillaume Berche
> > > > > Subject: RE: CONTRIB: recursive search in files of the 
> > current JDE
> > > > > project 
> > > > > 
> > > > > 
> > > > > thanks I would love the functionality, but:
> > > > > 
> > > > > jde-java-font-lock: building names cache...
> > > > > jde-java-font-lock: building names cache...empty
> > > > > Error in init file: Invalid function: "*.java"
> > > > > Loading cl-seq...
> > > > > Loading cl-seq...done
> > > > > File mode specification error: (invalid-function "*.java")
> > > > > 
> > > > > .emacs:
> > > > > ;; Tell Emacs to load the entire JDE package at startup 
> > > (only once).
> > > > > (require 'jde)
> > > > > 
> > > > > ;; The Emacs code browser (ECB)
> > > > > (require 'ecb)
> > > > > 
> > > > > ;; 
> > > > > (require 'jde-grep)
> > > > > 
> > > > > 
> > > > > /joel
> > > > > 


 jde-grep.el


RE: CONTRIB: recursive search in files of the current JDE project

2001-04-05 Thread Mark Bucciarelli

As someone who's thought about learning elisp, I'd say your first effort
sets a high standard!  :)

I have a suggested modification:  I think the line

   "find %s %s -type f | xargs grep %s -n \"%s\""

is improved by this

   "find %s %s -type f | xargs grep %s -n \"%s\" /dev/null"

(not sure if you need to escape the slashes.)

This way, grep won't miss any hits in the last file that find produces.

Also, I think there is a way to handle file names with spaces in them by
using a print0 argument to find, but I have never been able to get that to
work on my NT / cygwin box.

> -Original Message-
> From: Guillaume Berche [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 5:50 AM
> To: [EMAIL PROTECTED]
> Subject: CONTRIB: recursive search in files of the current 
> JDE project 
> 
> 
> Hello,
> 
> I eventually got some time to spend learning emacs-lisp (by 
> the way the
> elisp-introduction available at
> http://www.gnu.org/manual/emacs-lisp-intro/emacs-lisp-intro.html is
> really a great document to start learning elisp), and finally started
> implementing a new feature that I had been wishing the JDE to have.
> 
> So attached, it my first lisp function to search a string into all of
> the current JDE project files. It is merely a customization of the
> standard "grep" command to use the JDE customization variables (mainly
> the path to the source files). Please let me know what you 
> think and how
> to improve it!
> 
> To use it, include the file in your .emacs file (after 
> loading the jde)
> and type "M-x jde-grep-find"
> Its behavior can be customized, type "C-h f jde-grep-find" 
> for details.
> 
> Cheers,
> 
> Guillaume.
>