I just had to migrate to a new work computer and it took a bit of remembering to get ack working from emacs. For next time, here are the instructions for getting it to work.
- Install Perl
- Add the perl bin and site bin to the Windows Path
- Download the single file version of ack to the site bin (note the .pl extension):
curl http://beyondgrep.com/ack-2.12-single-file > c:\Strawberry\perl\site\bin\ack.pl
- Associate the .pl Extension with perl by running the following lines as an administrator:
This assumes that you’ve installed Strawberry Perl to the default installation directory.
ftype PerlScript=C:\Strawberry\bin\perl.exe "%1" %*
- Define an ack function for use in emacs (see Stack Overflow on ack in Emacs on Windows):
(defvar ack-command "ack --nogroup --nocolor ")
(defvar ack-history nil)
(defvar ack-host-defaults-alist nil)
(defun ack ()
"Like grep, but using ack-command as the default"
; Make sure grep has been initialized
(if (>= emacs-major-version 22)
; Close STDIN to keep ack from going into filter mode
(let ((null-device (format "< %s" null-device))
(setq ack-history grep-history