diff options
| author | Gerd Moellmann | 2001-03-28 15:34:38 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-28 15:34:38 +0000 |
| commit | 30a3f61cdcce439b00fc9a02f8642da77ca7fe03 (patch) | |
| tree | bef249bf9f36b9ab6757a9e8b1e1d03ffab335cb | |
| parent | 8efb6cc7ad3e0d0e3a84c206948d47123890a301 (diff) | |
| download | emacs-30a3f61cdcce439b00fc9a02f8642da77ca7fe03.tar.gz emacs-30a3f61cdcce439b00fc9a02f8642da77ca7fe03.zip | |
(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.
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/xdisp.c | 59 |
2 files changed, 55 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 83a0653a3c1..4fb63ac3f92 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,17 @@ | |||
| 1 | 2001-03-28 Gerd Moellmann <gerd@gnu.org> | 1 | 2001-03-28 Gerd Moellmann <gerd@gnu.org> |
| 2 | 2 | ||
| 3 | * eval.c (call_debugger): Bind `inhibit-redisplay' to nil, and | ||
| 4 | bind `inhibit-eval-during-redisplay' to t. | ||
| 5 | |||
| 6 | * lisp.h (Qinhibit_eval_during_redisplay): Declare extern. | ||
| 7 | |||
| 8 | * xdisp.c (inhibit_eval_during_redisplay) | ||
| 9 | (Qinhibit_eval_during_redisplay): New variables. | ||
| 10 | (safe_eval, safe_call): If inhibit_eval_during_redisplay is set, | ||
| 11 | don't eval, return nil instead. | ||
| 12 | (syms_of_xdisp): DEFVAR_BOOL inhibit-eval-during-redisplay. | ||
| 13 | Initialize Qinhibit_eval_during_redisplay. | ||
| 14 | |||
| 3 | * xdisp.c (reseat_to_string): If STRING is multibyte, set | 15 | * xdisp.c (reseat_to_string): If STRING is multibyte, set |
| 4 | the iterator's multibyte_p flag. | 16 | the iterator's multibyte_p flag. |
| 5 | 17 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index c31062232f1..f17467f63c7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -254,6 +254,10 @@ int auto_resize_tool_bars_p; | |||
| 254 | 254 | ||
| 255 | Lisp_Object Vinhibit_redisplay, Qinhibit_redisplay; | 255 | Lisp_Object Vinhibit_redisplay, Qinhibit_redisplay; |
| 256 | 256 | ||
| 257 | /* Non-zero means Lisp evaluation during redisplay is inhibited. */ | ||
| 258 | |||
| 259 | int inhibit_eval_during_redisplay, Qinhibit_eval_during_redisplay; | ||
| 260 | |||
| 257 | /* Names of text properties relevant for redisplay. */ | 261 | /* Names of text properties relevant for redisplay. */ |
| 258 | 262 | ||
| 259 | Lisp_Object Qdisplay, Qrelative_width, Qalign_to; | 263 | Lisp_Object Qdisplay, Qrelative_width, Qalign_to; |
| @@ -1278,15 +1282,24 @@ Lisp_Object | |||
| 1278 | safe_eval (sexpr) | 1282 | safe_eval (sexpr) |
| 1279 | Lisp_Object sexpr; | 1283 | Lisp_Object sexpr; |
| 1280 | { | 1284 | { |
| 1281 | int count = BINDING_STACK_SIZE (); | ||
| 1282 | struct gcpro gcpro1; | ||
| 1283 | Lisp_Object val; | 1285 | Lisp_Object val; |
| 1286 | |||
| 1287 | if (inhibit_eval_during_redisplay) | ||
| 1288 | val = Qnil; | ||
| 1289 | else | ||
| 1290 | { | ||
| 1291 | int count = BINDING_STACK_SIZE (); | ||
| 1292 | struct gcpro gcpro1; | ||
| 1284 | 1293 | ||
| 1285 | GCPRO1 (sexpr); | 1294 | GCPRO1 (sexpr); |
| 1286 | specbind (Qinhibit_redisplay, Qt); | 1295 | specbind (Qinhibit_redisplay, Qt); |
| 1287 | val = internal_condition_case_1 (Feval, sexpr, Qerror, safe_eval_handler); | 1296 | val = internal_condition_case_1 (Feval, sexpr, Qerror, |
| 1288 | UNGCPRO; | 1297 | safe_eval_handler); |
| 1289 | return unbind_to (count, val); | 1298 | UNGCPRO; |
| 1299 | val = unbind_to (count, val); | ||
| 1300 | } | ||
| 1301 | |||
| 1302 | return val; | ||
| 1290 | } | 1303 | } |
| 1291 | 1304 | ||
| 1292 | 1305 | ||
| @@ -1298,17 +1311,25 @@ safe_call (nargs, args) | |||
| 1298 | int nargs; | 1311 | int nargs; |
| 1299 | Lisp_Object *args; | 1312 | Lisp_Object *args; |
| 1300 | { | 1313 | { |
| 1301 | int count = BINDING_STACK_SIZE (); | ||
| 1302 | Lisp_Object val; | 1314 | Lisp_Object val; |
| 1303 | struct gcpro gcpro1; | 1315 | |
| 1316 | if (inhibit_eval_during_redisplay) | ||
| 1317 | val = Qnil; | ||
| 1318 | else | ||
| 1319 | { | ||
| 1320 | int count = BINDING_STACK_SIZE (); | ||
| 1321 | struct gcpro gcpro1; | ||
| 1304 | 1322 | ||
| 1305 | GCPRO1 (args[0]); | 1323 | GCPRO1 (args[0]); |
| 1306 | gcpro1.nvars = nargs; | 1324 | gcpro1.nvars = nargs; |
| 1307 | specbind (Qinhibit_redisplay, Qt); | 1325 | specbind (Qinhibit_redisplay, Qt); |
| 1308 | val = internal_condition_case_2 (Ffuncall, nargs, args, Qerror, | 1326 | val = internal_condition_case_2 (Ffuncall, nargs, args, Qerror, |
| 1309 | safe_eval_handler); | 1327 | safe_eval_handler); |
| 1310 | UNGCPRO; | 1328 | UNGCPRO; |
| 1311 | return unbind_to (count, val); | 1329 | val = unbind_to (count, val); |
| 1330 | } | ||
| 1331 | |||
| 1332 | return val; | ||
| 1312 | } | 1333 | } |
| 1313 | 1334 | ||
| 1314 | 1335 | ||
| @@ -14283,6 +14304,8 @@ syms_of_xdisp () | |||
| 14283 | staticpro (&Qgrow_only); | 14304 | staticpro (&Qgrow_only); |
| 14284 | Qinhibit_menubar_update = intern ("inhibit-menubar-update"); | 14305 | Qinhibit_menubar_update = intern ("inhibit-menubar-update"); |
| 14285 | staticpro (&Qinhibit_menubar_update); | 14306 | staticpro (&Qinhibit_menubar_update); |
| 14307 | Qinhibit_eval_during_redisplay = intern ("inhibit-eval-during-redisplay"); | ||
| 14308 | staticpro (&Qinhibit_eval_during_redisplay); | ||
| 14286 | 14309 | ||
| 14287 | last_arrow_position = Qnil; | 14310 | last_arrow_position = Qnil; |
| 14288 | last_arrow_string = Qnil; | 14311 | last_arrow_string = Qnil; |
| @@ -14511,6 +14534,10 @@ Can be used to update submenus whose contents should vary."); | |||
| 14511 | DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update, | 14534 | DEFVAR_BOOL ("inhibit-menubar-update", &inhibit_menubar_update, |
| 14512 | "Non-nil means don't update menu bars. Internal use only."); | 14535 | "Non-nil means don't update menu bars. Internal use only."); |
| 14513 | inhibit_menubar_update = 0; | 14536 | inhibit_menubar_update = 0; |
| 14537 | |||
| 14538 | DEFVAR_BOOL ("inhibit-eval-during-redisplay", &inhibit_eval_during_redisplay, | ||
| 14539 | "Non-nil means don't eval Lisp during redisplay."); | ||
| 14540 | inhibit_eval_during_redisplay = 0; | ||
| 14514 | } | 14541 | } |
| 14515 | 14542 | ||
| 14516 | 14543 | ||