2

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?

Daniel
  • 196
  • 7
  • Do the grep `elisp` functions work without byte compiling the library? – lawlist Jul 08 '15 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 08 '15 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 08 '15 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 08 '15 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. – Kaushal Modi Jul 09 '15 at 02:24
  • I had an outdated Emacs at my last job. I asked my admin to do `sudo apt-get install build-dep` - that's enough to build an up to date Emacs with only user rights. – abo-abo Jul 09 '15 at 10:44
  • @kaushalmodi thanks for your comments -- the network does not have access to updates/new software. That would be a trivial and desirable solution if it were the case! – Daniel Jul 09 '15 at 17:52
  • Daniel: FWIW, I pointed out Emacs 22.1 with the intent that you would grab those sources and try using that version of rgrep, as one could reasonably expect it to be the most-compatible (or most likely to *be* compatible) version of the library for your version of Emacs. – phils Jul 11 '15 at 02:19
  • @phils I understand. I'll try to do that. What it gave me the idea to do is diff the 21 version with the 24 version and see what slight syntax change is needed. – Daniel Jul 11 '15 at 15:30

1 Answers1

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.

Daniel
  • 196
  • 7