Created
February 12, 2014 18:19
-
-
Save tychoish/8961437 to your computer and use it in GitHub Desktop.
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
| (defun smart-grep () | |
| (interactive) | |
| (let ((search-text (buffer-substring-no-properties (region-beginning) (region-end))) | |
| (file buffer-file-name)) | |
| (let ((search-dir (concat (substring file 0 (search "/src/" file)) "/src/")) | |
| (search-extension (concat "*." (file-name-extension file)))) | |
| (rgrep search-text search-extension search-dir)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment