TraverseDirectory

ThierryVolpiatto?

TraverseDirectory

Lisp:traverselisp.el

This package work like ‘rgrep’, it is able to find regexp in files

across a tree of directory.

It can also replace founded regexps by what you want.

It provide also some other functions that use walk-directory to work in a directory tree.

Actually:

traverse-build-tags-in-project ⇒ build a tags file in directory (find files to tags in all subdirs)

traverse-cp-or-mv-extfiles-in-dir ⇒ cp or mv all files with ext in a special dir.

Install

Put this file in your load-path Add to your .emacs:

(require 'traverselisp)

My config with version-1.13

(require 'traverselisp)
(setq traverse-use-avfs t)
(global-set-key (kbd "<f12> f") 'traverse-deep-rfind)
(global-set-key (kbd "<f12> u") 'traverse-build-tags-in-project)
(define-key dired-mode-map (kbd "C-c t") 'traverse-dired-search-regexp-in-anything-at-point)
(define-key dired-mode-map (kbd "C-c C-z") 'traverse-dired-browse-archive)
(add-to-list 'traverse-ignore-files ".ledger-cache")

Usage

M-x traverse-deep-rfind

When searching is done and you are in traverse buffer

some actions are provided for navigate and for replacing regexps

Use “C-h m” for more info while in traverse-buffer.

M-x traverse-dired-search-regexp-in-anything-at-point

This function work on directory, files, (1)compressed files (avfs)

And marked files. It will find alone the good action to perform.

You will find also specialized functions to run on individual file

archives, directories and marked files but traverse-dired-search-regexp-in-anything-at-point

should always do what you want.

M-x traverse-dired-browse-archive

This function use (1)avfs to browse archive tar.gz, bz2 etc.. in dired.

traverse-cp-or-mv-extfiles-in-dir ⇒ Move all files with .ext found in all subdirs in Dir.

traverse-build-tags-in-project ⇒ Create a TAGS file with all file found in project (in subdirs also)

Possibility to give different ext of file separate with a space. ⇒ .py .el

(1)NOTE: You have to install avfs and enable fuse in your kernel if

you want to browse and search in archives.

Please see the doc of your distrib.

and the doc of avfs

http://sourceforge.net/projects/avf

You can also get the last version of the file with mercurial:

hg clone http://freehg.org/u/thiedlecques/traverselisp/

You can get the old version that work with python as backend here:

hg clone http://freehg.org/u/thiedlecques/traversedirectory/

Your comments

Add your comments here:

Bug report

Report bugs here:

The prompt of traverse-read-regexp is not unifying.


(defun traverse-read-regexp (&rest args)
  "For compatibility with emacs-22.
Use `read-string' in emacs-22 instead of using `read-regexp'.
Use the same args as `read-string' or `read-regexp'
depending of what emacs version you use.
NOTE:When using `read-string' some regexp (complex)
may not be displayed correctly to traverselisp"
  (apply #'funcall (if (fboundp 'read-regexp)
                       'read-regexp
                       'read-string)
         args))
the argument "Regexp: " will be pass to `traverse-read-regexp' from caller `traverse-deep-rfind'. 
To emacs23, `read-regexp' will take that argument, the Minibuffer will display "Regexp: : ". 

It is not unifying with the prompt of `read-string'.

If you have something at point, it will be displayed in the prompt as (maybe) a default argument.

To use this default argument, hit arrow down.

Icicles users will have “Regexp: (default arg): “, if you have not icicles your prompt is probably empty:

“Regexp: :”.

I will fix that as soon as possible. Waiting that fix, just hit arrow down to see default arg.

– ThierryVolpiatto?

I have tried. But why not use “Regexp “, not just “Regexp”.

Fixed thanks.

– ThierryVolpiatto?

Thanks for your work.