From f7f8e5254e653b2f90892c16c84de6da82a30e43 Mon Sep 17 00:00:00 2001 From: Tim Van Holder Date: Wed, 20 Feb 2002 18:10:17 +0000 Subject: [PATCH] * m4/lispdir.m4: Redirect /dev/null to stdin when running $EMACS to try and prevent a non-lisp emacs from starting in interactive mode. * automake.texi: Document this change. --- ChangeLog | 7 +++++++ automake.texi | 11 +++++++++++ m4/lispdir.m4 | 7 ++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8c84bd53..9e92e16d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-02-20 Tim Van Holder + + * m4/lispdir.m4: Redirect /dev/null to stdin when running $EMACS + to try and prevent a non-lisp emacs from starting in interactive + mode. + * automake.texi: Document this change. + 2002-02-19 Alexandre Duret-Lutz * automake.texi (Macros): Split into ... diff --git a/automake.texi b/automake.texi index 447b95a5..15e61c3a 100644 --- a/automake.texi +++ b/automake.texi @@ -1447,6 +1447,17 @@ or by passing a third non-empty argument to the obsolete form. @item AM_PATH_LISPDIR Searches for the program @code{emacs}, and, if found, sets the output variable @code{lispdir} to the full path to Emacs' site-lisp directory. + +Note that this test assumes the @code{emacs} found to be a version that +supports Emacs Lisp (such as @sc{gnu} Emacs or XEmacs). Other emacsen +can cause this test to hang (some, like old versions of MicroEmacs, +start up in interactive mode, requiring @samp{C-x C-c} to exit, which +is hardly obvious for a non-emacs user). In most cases, however, you +should be able to use @samp{C-c} to kill the test. In order to avoid +problems, you can set @code{EMACS} to ``no'' in the environment, or +use the @samp{--with-lispdir} option to @command{configure} to +explictly set the correct path (if you're sure you have an @code{emacs} +that supports Emacs Lisp. @cvindex AM_PATH_LISPDIR @item AM_PROG_AS diff --git a/m4/lispdir.m4 b/m4/lispdir.m4 index 4d7b60d1..a790ad43 100644 --- a/m4/lispdir.m4 +++ b/m4/lispdir.m4 @@ -39,7 +39,12 @@ AC_DEFUN([AM_PATH_LISPDIR], if test $EMACS != "no"; then if test x${lispdir+set} != xset; then AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], - [AC_RUN_LOG([$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' >conftest.out]) + [# If $EMACS isn't GNU Emacs or XEmacs, this can blow up pretty badly + # Some emacsen will start up in interactive mode, requiring C-x C-c to exit, + # which is non-obvious for non-emacs users. + # Redirecting /dev/null should help a bit; pity we can't detect "broken" + # emacsen earlier and avoid running this altogether. + AC_RUN_LOG([$EMACS -batch -q -eval '(while load-path (princ (concat (car load-path) "\n")) (setq load-path (cdr load-path)))' conftest.out]) am_cv_lispdir=`sed -n \ -e 's,/$,,' \ -e '/.*\/lib\/\(x\?emacs\/site-lisp\)$/{s,,${libdir}/\1,;p;q;}' \ -- 2.43.5