[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Old Emacs check

From: Eric Sunshine
Subject: Old Emacs check
Date: Thu, 2 Oct 2003 09:30:07 -0400


The autoconf-mode.el and autotest-mode.el scripts do not work with older  
versions of Emacs (18.x.x).  Emacs throws an error when trying to  
byte-compile these files. This problem causes Autoconf's "make" and "make  
install" to fail.  Here is a patch for Autoconf's which adds a  
check for a sufficiently recent version of Emacs.

---        Tue Sep 30 09:05:56 2003
+++    Thu Oct  2 09:12:13 2003
@@ -76,10 +76,34 @@

 # Emacs modes.
-test x"$EMACS" = xt && EMACS=
-AC_CHECK_PROGS(EMACS, emacs xemacs, no)
+test x"$TEST_EMACS" = xt && TEST_EMACS=
+AC_CHECK_PROGS(TEST_EMACS, emacs xemacs, no)
+# autoconf-mode.el and autotest-mode.el do not work with older version of
+# Emacs (i.e. 18.x.x).  During byte-compilation, Emacs complains:
+# "Variable (broken nil) seen on pass 2 of byte compiler but not pass 1"
+# We detect this problem here.
+AS_IF([test "$TEST_EMACS" != no],
+  [AC_CACHE_CHECK([whether $TEST_EMACS is sufficiently recent],
+    [ac_cv_prog_emacs_ok],
+    [# Note: The quoted "EOF" is intentional.  It protects the ` in the text.
+    cat >conftest.el << "EOF"
+      (defvar broken)
+      (defun broken-mode () (setq broken-defaults `(broken nil)))
+      [$TEST_EMACS -batch -q -f batch-byte-compile conftest.el 1>&2])],
+      [ac_cv_prog_emacs_ok=yes], [ac_cv_prog_emacs_ok=no])
+    rm -f conftest.el conftest.elc])
+  AS_IF([test $ac_cv_prog_emacs_ok = no], [TEST_EMACS=no])])

+# Conclusion
 AC_CONFIG_FILES([Makefile doc/Makefile
                  lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile

reply via email to

[Prev in Thread] Current Thread [Next in Thread]