Hi,

I am attaching my configuration here if you want to have a look.

1. I have cygwin installed on my windows so I have the access to quick
functions like updatedb and locate, *nix users will have no problem.
2. The only parameter you want to change below is core-rootpath, which
is my project root.
3. It will try to use 'locate' (very fast) and also 'find' (slow) at
the same time, in case the locate can't find a file that is just
added, you can wait for the 'find' results to come back

(require 'anything)

(defun core-anything ()
  (interactive)
  (anything core-anything-sources))

(defun core-anything-source-candidate-transformer (candidates)
  (loop for candidate in candidates
                unless (or (string-match "#" candidate)
                                   (string-match "~" candidate)
                                   (string-match "\\.class" candidate)
                                   (string-match "\\.war" candidate)
                                   (string-match "\\.jar" candidate)
                                   (string-match "\\.ear" candidate)
                                   (file-directory-p candidate))
                collect candidate))

(defun core-updatedb ()
  (interactive)
  (let ((args
                 (format "--localpaths='%s' --output='%s/locatedb'" 
core-rootpath
core-rootpath)))
        (start-process-shell-command "updatedb-process" " core-updatedb"
"updatedb" args)))

(setq core-anything-sources '(((name . "Buffers")
                                                           (candidates
                                                                . (lambda ()
                                                                        
(remove-if (lambda (name)
                                                                                
                 (or (equal name anything-buffer)
                                                                                
                         (eq ?\  (aref name 0))))
                                                                                
           (mapcar 'buffer-name (buffer-list)))))
                                                           (type . buffer))
                                                          ((name . "Local 
Locatedb")
                                                           (init . (lambda ()
                                                                                
 (setq anything-default-directory
                                                                                
           default-directory)))
                                                           (candidates
                                                                . (lambda ()
                                                                        (let 
((args
                                                                                
   (format "-d locatedb -b -i %s"
                                                                                
                   anything-pattern)))
                                                                          (cd 
core-rootpath)
                                                                          
(start-process-shell-command "locate-search-process" " core-locate"
                                                                                
                                                   "locate" args))))
                                                           
(candidate-transformer . core-anything-source-candidate-transformer)
                                                           (type . file)
                                                           (requires-pattern . 
3)
                                                           (delayed))
                                                          ((name . "File 
Search")
                                                           (init . (lambda ()
                                                                                
 (setq anything-default-directory
                                                                                
           default-directory)))
                                                           (candidates
                                                                . (lambda ()
                                                                        (let 
((args
                                                                                
   (format "%s -iname '*%s*' -print"
                                                                                
                   core-rootpath
                                                                                
                   anything-pattern)))
                                                                          
(start-process-shell-command "file-search-process" nil
                                                                                
                                                   "find" args))))
                                                           
(candidate-transformer . core-anything-source-candidate-transformer)
                                                           (type . file)
                                                           (requires-pattern . 
3)
                                                           (delayed))))

(global-set-key (kbd "\C-c o") 'core-anything)


-- 
Cheers,
Phuah Yee Keat

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
jdee-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdee-users

Reply via email to