Created
February 11, 2010 04:13
-
-
Save tobias/301205 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ack-in-project (pattern) | |
"Run ack, with user-specified ARGS, and collect output in a buffer. | |
While ack runs asynchronously, you can use the \\[next-error] command to | |
find the text that ack hits refer to. The command actually run is | |
defined by the ack-command variable." | |
(interactive (list (read-string "Ack for (in app root): " (thing-at-point 'symbol)))) | |
(let (compile-command | |
(compilation-error-regexp-alist grep-regexp-alist) | |
(compilation-directory default-directory) | |
(ack-full-buffer-name (concat "*ack-" pattern "*"))) | |
;; lambda defined here since compilation-start expects to call a function to get the buffer name | |
(compilation-start (concat ack-command " -i --noheading --nocolor " pattern " " (rinari-root)) 'ack-mode | |
(when ack-use-search-in-buffer-name | |
(function (lambda (ignore) | |
ack-full-buffer-name))) | |
(regexp-quote pattern)))) | |
(global-set-key "\C-cfa" 'ack-in-project) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment