I'd like to restrict find/grep to (say) only javascript files (mainly because that's what i do in "another editor").
Javascript files in my legacy Ruby-on-Rails project have one of these file extensions:-
.js, .js.erb, .coffee, .js.coffee, .js.coffee.erb, .jsx, .js.jsx, .js.jsx.erb (and maybe more)
If i could, i would restrict find to files with these file extensions, and pre-define this list so i don't have to type it each time.
I think i need to write a custom function, if there is a way to specify filetype, but I'm struggling to discover how to do this.. and maybe I've just picked up a weird workflow from my old editor?
EDIT: sorry the question wasn't clear.. i don't want to fix it so that emacs always searches in Javascript files.. when i want to search in Javascript files, i want to search only files with those extensions.. when i want to search in html files i want to only search in files with extensions .html, .html.erb, .html.haml, .haml, etc.