diff src/eval.c @ 298:70ad99077275 r21-0b47

Import from CVS: tag r21-0b47
author cvs
date Mon, 13 Aug 2007 10:39:40 +0200
parents 90d73dddcdc4
children 33bdb3d4b97f
line wrap: on
line diff
--- a/src/eval.c	Mon Aug 13 10:38:47 2007 +0200
+++ b/src/eval.c	Mon Aug 13 10:39:40 2007 +0200
@@ -3726,20 +3726,29 @@
 	    {
 	      /* t indicates this hook has a local binding;
 		 it means to run the global binding too.  */
-	      Lisp_Object globals;
-
-	      for (globals = Fdefault_value (sym);
-		   CONSP (globals) && ((cond == RUN_HOOKS_TO_COMPLETION)
-				       || (cond == RUN_HOOKS_UNTIL_SUCCESS
-					   ? NILP (ret)
-					   : !NILP (ret)));
-		   globals = XCDR (globals))
+	      Lisp_Object globals = Fdefault_value (sym);
+
+	      if ((! CONSP (globals) || EQ (XCAR (globals), Qlambda)) &&
+		  ! NILP (globals))
+		{
+		  args[0] = globals;
+		  ret = Ffuncall (nargs, args);
+		}
+	      else
 		{
-		  args[0] = XCAR (globals);
-		  /* In a global value, t should not occur.  If it does, we
-		     must ignore it to avoid an endless loop.  */
-		  if (!EQ (args[0], Qt))
-		    ret = Ffuncall (nargs, args);
+		  for (;
+		       CONSP (globals) && ((cond == RUN_HOOKS_TO_COMPLETION)
+					   || (cond == RUN_HOOKS_UNTIL_SUCCESS
+					       ? NILP (ret)
+					       : !NILP (ret)));
+		       globals = XCDR (globals))
+		    {
+		      args[0] = XCAR (globals);
+		      /* In a global value, t should not occur.  If it does, we
+			 must ignore it to avoid an endless loop.  */
+		      if (!EQ (args[0], Qt))
+			ret = Ffuncall (nargs, args);
+		    }
 		}
 	    }
 	  else