Created
October 25, 2012 20:54
-
-
Save daimatz/3955330 to your computer and use it in GitHub Desktop.
grep string in recentf-list
This file contains hidden or 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
(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