Skip to content

Instantly share code, notes, and snippets.

@higepon
Created December 26, 2012 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save higepon/4378274 to your computer and use it in GitHub Desktop.
Save higepon/4378274 to your computer and use it in GitHub Desktop.
Use ack from Emacs. Wand to remove the last "interactive". Any suggestions?
(defun ack (directory keyword)
(setq default-directory (if (string= "dired-mode" major-mode)
(dired-current-directory)
(file-name-directory (buffer-file-name (current-buffer)))))
(interactive "D:What directory? \ns:keyword? ")
(grep-apply-setting 'grep-find-command (format "ack --nocolor --nogroup %s %s" keyword directory))
(call-interactively 'grep-find))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment