Skip to content

Instantly share code, notes, and snippets.

@daimatz
Created October 25, 2012 20:54
Show Gist options
  • Save daimatz/3955330 to your computer and use it in GitHub Desktop.
Save daimatz/3955330 to your computer and use it in GitHub Desktop.
grep string in recentf-list
(require 'anything-grep)
(defun recentf-grep (str)
(interactive "sSearch: ")
(let* ((files (mapconcat #'(lambda (x) (concat "'" x "'"))
(filter #'file-readable-p recentf-list) " "))
(command (concat "grep -i -nH -e " str " " files))
(pwd "/tmp")
(src (agrep-source (agrep-preprocess-command command) pwd)))
(setcdr (assoc 'name src) (format "grep %s in recentf-list" str))
(anything-grep-base (list src) (format " *recentf-grep:%s*" str))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment