ディレクトリと探したいもの与えると grep-find してくれる関数

;; dgrep-find
(defun dgrep-find (dir subject &optional cmd)
  (interactive "DDiretory: \nsSubject: ")
  (let (
        (cmd (or cmd "find %s -type f ! -wholename '*/.svn/*' ! -wholename '*/tplc/*' -name '*.php' | xargs grep -3 -nH '%s'"))
        )
    (when (tramp-tramp-file-p dir)
      (setq dir (tramp-file-name-localname
                      (tramp-dissect-file-name (expand-file-name dir)))))
    (grep-find (format cmd dir subject))
    )
  )
  • grep のオプションも与えるようにしたりしたらより汎用的かしら