diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-03-29 01:46:10 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-03-29 01:46:10 +0000 |
commit | 58555d8187f3425f69e57316cfcd296f8fe08433 (patch) | |
tree | 6483ae1ed8053ad2f3ec7c41241a2e7ab443a5f1 /src/xdisp.c | |
parent | 769087cead629d7ad1fd5cfc15ce75625a78e6b3 (diff) | |
download | emacs-58555d8187f3425f69e57316cfcd296f8fe08433.tar.gz |
* keyboard.c (pending_funcalls): New var.
(timer_check): Run it.
(syms_of_keyboard): Initialize it.
* terminal.c (Qrun_hook_with_args, Qdelete_terminal_functions)
(Vdelete_terminal_functions): New vars.
(syms_of_terminal): Initialize them.
(Fdelete_terminal): Run delete-terminal-functions.
* xdisp.c (safe_eval): Rewrite.
(safe_call2): New fun.
* frame.c (Qdelete_frame_functions): New var.
(syms_of_frame): Initialize it.
(Fdelete_frame): Use it and use safe_call2 and pending_funcalls.
* lisp.h (safe_call2, pending_funcalls): Declare.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 70db580bb0d..073d6a79068 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2316,33 +2316,6 @@ safe_eval_handler (arg) /* Evaluate SEXPR and return the result, or nil if something went wrong. Prevent redisplay during the evaluation. */ -Lisp_Object -safe_eval (sexpr) - Lisp_Object sexpr; -{ - Lisp_Object val; - - if (inhibit_eval_during_redisplay) - val = Qnil; - else - { - int count = SPECPDL_INDEX (); - struct gcpro gcpro1; - - GCPRO1 (sexpr); - specbind (Qinhibit_redisplay, Qt); - /* Use Qt to ensure debugger does not run, - so there is no possibility of wanting to redisplay. */ - val = internal_condition_case_1 (Feval, sexpr, Qt, - safe_eval_handler); - UNGCPRO; - val = unbind_to (count, val); - } - - return val; -} - - /* Call function ARGS[0] with arguments ARGS[1] to ARGS[NARGS - 1]. Return the result, or nil if something went wrong. Prevent redisplay during the evaluation. */ @@ -2389,6 +2362,27 @@ safe_call1 (fn, arg) return safe_call (2, args); } +static Lisp_Object Qeval; + +Lisp_Object +safe_eval (Lisp_Object sexpr) +{ + return safe_call1 (Qeval, sexpr); +} + +/* Call function FN with one argument ARG. + Return the result, or nil if something went wrong. */ + +Lisp_Object +safe_call2 (Lisp_Object fn, Lisp_Object arg1, Lisp_Object arg2) +{ + Lisp_Object args[3]; + args[0] = fn; + args[1] = arg1; + args[2] = arg2; + return safe_call (3, args); +} + /*********************************************************************** @@ -8634,7 +8628,7 @@ current_message () { Lisp_Object msg; - if (NILP (echo_area_buffer[0])) + if (!BUFFERP (echo_area_buffer[0])) msg = Qnil; else { @@ -24359,6 +24353,9 @@ syms_of_xdisp () staticpro (&Qinhibit_point_motion_hooks); Qinhibit_point_motion_hooks = intern ("inhibit-point-motion-hooks"); + Qeval = intern ("eval"); + staticpro (&Qeval); + QCdata = intern (":data"); staticpro (&QCdata); Qdisplay = intern ("display"); |