Sadly I am stuck using Emacs version 21.4 in a work environment. Despite this I would very much like to be able to use rgrep.

Either the version of Emacs 21.4 I have has been stripped down, or rgrep doesn't ship with rgrep. I have transferred the grep.el from a 24.5 system. When I try to byte-compile grep.el and it's require dependencies I get the following error in macroexp.el:

Invalid read syntax ((". in wrong context"))

I can't find any syntax errors in macroexp.el ( and would be very surprised to find any) so I'm wondering if this is a version (in)compatibility issue which I can overcome with some simple edits?

  • Do the grep elisp functions work without byte compiling the library?
    – lawlist
    Jul 8, 2015 at 20:44
  • well, this is tricky. I manually evaluated all the sexp's, without error. But eval-buffer fails with the same error. I suspect I missed one of the hundreds of sexp's in the file.
    – Daniel
    Jul 8, 2015 at 20:46
  • I would suggest you take the less-optimistic approach of using a much older version of the library. Emacs 24 in particular introduced some significant changes to the elisp interpreter, and it would not be at all surprising for newer libraries to not work in an older version. The NEWS files tell me that rgrep was introduced in 22.1.
    – phils
    Jul 8, 2015 at 21:58
  • Thanks for the info about the elisp interpreter. That puts it on shakier ground. I saw the NEWS comment about rgrep - that is partly what led me to posting asking if rgrep would be back-portable to version 21.
    – Daniel
    Jul 8, 2015 at 22:44
  • 1
    This is not the direct solution to your question but have you given a try building the latest emacs version in your $HOME using the --prefix configure option? Installing it the very first time could be a bit tricky as you figure out which dependencies you might also need to build locally. But once done the first time, future upgrades will be smooth. Jul 9, 2015 at 2:24

1 Answer 1


Well, while waiting for an answer I simply implemented a simple version of rgrep functionality myself. I was hoping to find a way to re-use the existing rgrep.el functionality but couldn't get it to work. not sure if that is a Emacs 21 version incompatibility or some thing else.

I took the simple route and invoked "find -exec grep", inserting results into a new buffer.

I haven't been able to transfer grep-mode.el either, so that's missing but I implemented (for me) the key bit I needed which was click-and-jump-to-location.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.