2001-03-28 Gerd Moellmann <gerd@gnu.org>
+ * eval.c (call_debugger): Bind `inhibit-redisplay' to nil, and
+ bind `inhibit-eval-during-redisplay' to t.
+
+ * lisp.h (Qinhibit_eval_during_redisplay): Declare extern.
+
+ * xdisp.c (inhibit_eval_during_redisplay)
+ (Qinhibit_eval_during_redisplay): New variables.
+ (safe_eval, safe_call): If inhibit_eval_during_redisplay is set,
+ don't eval, return nil instead.
+ (syms_of_xdisp): DEFVAR_BOOL inhibit-eval-during-redisplay.
+ Initialize Qinhibit_eval_during_redisplay.
+
* xdisp.c (reseat_to_string): If STRING is multibyte, set
the iterator's multibyte_p flag.
Lisp_Object Vinhibit_redisplay, Qinhibit_redisplay;
+/* Non-zero means Lisp evaluation during redisplay is inhibited. */
+
+int inhibit_eval_during_redisplay, Qinhibit_eval_during_redisplay;
+
/* Names of text properties relevant for redisplay. */
Lisp_Object Qdisplay, Qrelative_width, Qalign_to;
safe_eval (sexpr)
Lisp_Object sexpr;
{
- int count = BINDING_STACK_SIZE ();
- struct gcpro gcpro1;
Lisp_Object val;
+
+ if (inhibit_eval_during_redisplay)
+ val = Qnil;
+ else
+ {
+ int count = BINDING_STACK_SIZE ();
+ struct gcpro gcpro1;
- GCPRO1 (sexpr);
- specbind (Qinhibit_redisplay, Qt);
- val = internal_condition_case_1 (Feval, sexpr, Qerror, safe_eval_handler);
- UNGCPRO;
- return unbind_to (count, val);
+ GCPRO1 (sexpr);
+ specbind (Qinhibit_redisplay, Qt);
+ val = internal_condition_case_1 (Feval, sexpr, Qerror,
+ safe_eval_handler);
+ UNGCPRO;
+ val = unbind_to (count, val);
+ }
+
+ return val;
}
int nargs;
Lisp_Object *args;
{
- int count = BINDING_STACK_SIZE ();
Lisp_Object val;
- struct gcpro gcpro1;
+
+ if (inhibit_eval_during_redisplay)
+ val = Qnil;
+ else
+ {
+ int count = BINDING_STACK_SIZE ();
+ struct gcpro gcpro1;
- GCPRO1 (args[0]);
- gcpro1.nvars = nargs;
- specbind (Qinhibit_redisplay, Qt);
- val = internal_condition_case_2 (Ffuncall, nargs, args, Qerror,
- safe_eval_handler);
- UNGCPRO;
- return unbind_to (count, val);
+ GCPRO1 (args[0]);
+ gcpro1.nvars = nargs;
+ specbind (Qinhibit_redisplay, Qt);
+ val = internal_condition_case_2 (Ffuncall, nargs, args, Qerror,
+ safe_eval_handler);
+ UNGCPRO;
+ val = unbind_to (count, val);
+ }
+
+ return val;
}
staticpro (&Qgrow_only);
Qinhibit_menubar_update = intern ("inhibit-menubar-update");
staticpro (&Qinhibit_menubar_update);
+ Qinhibit_eval_during_redisplay = intern ("inhibit-eval-during-redisplay");
+ staticpro (&Qinhibit_eval_during_redisplay);
last_arrow_position = Qnil;
last_arrow_string = Qnil;
DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update,
"Non-nil means don't update menu bars. Internal use only.");
inhibit_menubar_update = 0;
+
+ DEFVAR_BOOL ("inhibit-eval-during-redisplay", &inhibit_eval_during_redisplay,
+ "Non-nil means don't eval Lisp during redisplay.");
+ inhibit_eval_during_redisplay = 0;
}