for emacs grep function