ack is a replacement for 99% of the uses of grep, written in Perl. Ack searches recursively through directories by default, while ignoring backup files, binary files, SubVersion, CVS and other VCS directories.

There are several GrepMode-like interfaces for Ack:

A minimalistic interface to Ack is:

(defvar ack-history nil
  "History for the `ack' command.")

(defun ack (command-args)
   (let ((ack-command "ack --nofilter --nogroup --with-filename "))
     (list (read-shell-command "Run ack (like this): "
  (let ((compilation-disable-input t))
    (compilation-start (concat command-args " < " null-device)

Alternatively, one can use M-x rgrep with ack thusly:

(grep-apply-setting 'grep-command "ack --with-filename --nofilter --nogroup ")

Beware of problems with ack’s automatic detection of filter mode! You might need to set compilation-disable-input to t and/or redirect the standard input of the ack command to /dev/null.

CategoryExternalUtilities CategoryRegexp