Skip to content

Instantly share code, notes, and snippets.

@ijp
Created April 22, 2014 17:13
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 ijp/11187193 to your computer and use it in GitHub Desktop.
Save ijp/11187193 to your computer and use it in GitHub Desktop.
(defun raellear-lgrep (regexp &optional files confirm)
(interactive
(progn
(grep-compute-defaults)
(cond
((and grep-command (equal current-prefix-arg '(16)))
(list (read-from-minibuffer "Run: " grep-command
nil nil 'grep-history)))
((not grep-template)
(error "grep.el: No `grep-template' available"))
(t (let* ((regexp (grep-read-regexp))
(files (grep-read-files regexp))
(confirm (equal current-prefix-arg '(4))))
(list regexp files dir confirm))))))
(lgrep regexp files "/insert/your/directory/here/" confirm))
(global-set-key (kbd "C-c g") 'raellear-lgrep)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment