Subject: Re: bug#18476: 24.3.93; ede-emacs-version: Searching for program: no such file or directory, egrep

From: David Engster <[email-masked]>
Date: Mon, 15 Sep 2014 22:16:10 +0200

Lars Ljung writes:
> Every time I open a file in the Emacs source tree I see the message
> "ede-emacs-version: Searching for program: no such file or directory,
> egrep". Also, Emacs does not switch to the newly created buffer so I
> have to switch to it manually.
>
> This only happens on Windows, where I don't have egrep installed. It is
> caused by line 86 in lisp/cedet/ede/emacs.el:
>
> (call-process "egrep" nil buff nil "-n" "-e" "AC_INIT" configure_ac)
>
> I don't think this line is even necessary. The file content is inserted
> and parsed further down.

Indeed. That call to egrep seems to be some relict from the old
days. Additionally, we should also make sure that configure.ac or
configure.in exist.

Stefan, would it be OK to install the attached patch to emacs-24, or
should it go to trunk?

-David

=== modified file 'lisp/cedet/ede/emacs.el'
--- lisp/cedet/ede/emacs.el	2014-04-02 15:14:50 +0000
+++ lisp/cedet/ede/emacs.el	2014-09-15 20:10:45 +0000
@@ -82,10 +82,6 @@
       (setq default-directory (file-name-as-directory dir))
       (or (file-exists-p configure_ac)
 	  (setq configure_ac "configure.in"))
-      ;(call-process "egrep" nil buff nil "-n" "-e" "^version=" "Makefile")
-      (call-process "egrep" nil buff nil "-n" "-e" "AC_INIT" configure_ac)
-      (goto-char (point-min))
-      ;(re-search-forward "version=\\([0-9.]+\\)")
       (cond
        ;; Maybe XEmacs?
        ((file-exists-p "version.sh")
@@ -113,7 +109,8 @@
        ;; Insert other Emacs here...
 
        ;; Vaguely recent version of GNU Emacs?
-       (t
+       ((or (file-exists-p configure_ac)
+	    (file-exists-p (setq configure_ac "configure.in")))
 	(insert-file-contents configure_ac)
 	(goto-char (point-min))
 	(re-search-forward "AC_INIT(\\(?:GNU \\)?[eE]macs,\\s-*\\([0-9.]+\\)\\s-*[,)]")