comparison src/keyboard.c @ 62493:e598462c7b22

(syms_of_keyboard): Remove lisp variables post-command-idle-hook and post-command-idle-delay. (command_loop_1): Don't try to execute post-command-idle-hook.
author Nick Roberts <nickrob@snap.net.nz>
date Wed, 18 May 2005 23:19:56 +0000
parents 68eb1c8b3f80
children 3cf2ae5f446d 21eea50897a7 f042e7c0fe20
comparison
equal deleted inserted replaced
62492:2d94ce2501bb 62493:e598462c7b22
448 448
449 /* Hooks to run before and after each command. */ 449 /* Hooks to run before and after each command. */
450 Lisp_Object Qpre_command_hook, Vpre_command_hook; 450 Lisp_Object Qpre_command_hook, Vpre_command_hook;
451 Lisp_Object Qpost_command_hook, Vpost_command_hook; 451 Lisp_Object Qpost_command_hook, Vpost_command_hook;
452 Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal; 452 Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal;
453 /* Hook run after a command if there's no more input soon. */
454 Lisp_Object Qpost_command_idle_hook, Vpost_command_idle_hook;
455
456 /* Delay time in microseconds before running post-command-idle-hook. */
457 EMACS_INT post_command_idle_delay;
458 453
459 /* List of deferred actions to be performed at a later time. 454 /* List of deferred actions to be performed at a later time.
460 The precise format isn't relevant here; we just check whether it is nil. */ 455 The precise format isn't relevant here; we just check whether it is nil. */
461 Lisp_Object Vdeferred_action_list; 456 Lisp_Object Vdeferred_action_list;
462 457
1445 if (!NILP (echo_area_buffer[0])) 1440 if (!NILP (echo_area_buffer[0]))
1446 resize_echo_area_exactly (); 1441 resize_echo_area_exactly ();
1447 1442
1448 if (!NILP (Vdeferred_action_list)) 1443 if (!NILP (Vdeferred_action_list))
1449 safe_run_hooks (Qdeferred_action_function); 1444 safe_run_hooks (Qdeferred_action_function);
1450
1451 if (!NILP (Vpost_command_idle_hook) && !NILP (Vrun_hooks))
1452 {
1453 if (NILP (Vunread_command_events)
1454 && NILP (Vunread_input_method_events)
1455 && NILP (Vunread_post_input_method_events)
1456 && NILP (Vexecuting_kbd_macro)
1457 && !NILP (sit_for (0, post_command_idle_delay, 0, 1, 1)))
1458 safe_run_hooks (Qpost_command_idle_hook);
1459 }
1460 } 1445 }
1461 1446
1462 Vmemory_full = Qnil; 1447 Vmemory_full = Qnil;
1463 1448
1464 /* Do this after running Vpost_command_hook, for consistency. */ 1449 /* Do this after running Vpost_command_hook, for consistency. */
1820 resize_echo_area_exactly (); 1805 resize_echo_area_exactly ();
1821 1806
1822 if (!NILP (Vdeferred_action_list)) 1807 if (!NILP (Vdeferred_action_list))
1823 safe_run_hooks (Qdeferred_action_function); 1808 safe_run_hooks (Qdeferred_action_function);
1824 1809
1825 if (!NILP (Vpost_command_idle_hook) && !NILP (Vrun_hooks))
1826 {
1827 if (NILP (Vunread_command_events)
1828 && NILP (Vunread_input_method_events)
1829 && NILP (Vunread_post_input_method_events)
1830 && NILP (Vexecuting_kbd_macro)
1831 && !NILP (sit_for (0, post_command_idle_delay, 0, 1, 1)))
1832 safe_run_hooks (Qpost_command_idle_hook);
1833 }
1834
1835 /* If there is a prefix argument, 1810 /* If there is a prefix argument,
1836 1) We don't want Vlast_command to be ``universal-argument'' 1811 1) We don't want Vlast_command to be ``universal-argument''
1837 (that would be dumb), so don't set Vlast_command, 1812 (that would be dumb), so don't set Vlast_command,
1838 2) we want to leave echoing on so that the prefix will be 1813 2) we want to leave echoing on so that the prefix will be
1839 echoed as part of this key sequence, so don't call 1814 echoed as part of this key sequence, so don't call
10853 staticpro (&Qpre_command_hook); 10828 staticpro (&Qpre_command_hook);
10854 10829
10855 Qpost_command_hook = intern ("post-command-hook"); 10830 Qpost_command_hook = intern ("post-command-hook");
10856 staticpro (&Qpost_command_hook); 10831 staticpro (&Qpost_command_hook);
10857 10832
10858 Qpost_command_idle_hook = intern ("post-command-idle-hook");
10859 staticpro (&Qpost_command_idle_hook);
10860
10861 Qdeferred_action_function = intern ("deferred-action-function"); 10833 Qdeferred_action_function = intern ("deferred-action-function");
10862 staticpro (&Qdeferred_action_function); 10834 staticpro (&Qdeferred_action_function);
10863 10835
10864 Qcommand_hook_internal = intern ("command-hook-internal"); 10836 Qcommand_hook_internal = intern ("command-hook-internal");
10865 staticpro (&Qcommand_hook_internal); 10837 staticpro (&Qcommand_hook_internal);
11300 doc: /* Normal hook run after each command is executed. 11272 doc: /* Normal hook run after each command is executed.
11301 If an unhandled error happens in running this hook, 11273 If an unhandled error happens in running this hook,
11302 the hook value is set to nil, since otherwise the error 11274 the hook value is set to nil, since otherwise the error
11303 might happen repeatedly and make Emacs nonfunctional. */); 11275 might happen repeatedly and make Emacs nonfunctional. */);
11304 Vpost_command_hook = Qnil; 11276 Vpost_command_hook = Qnil;
11305
11306 DEFVAR_LISP ("post-command-idle-hook", &Vpost_command_idle_hook,
11307 doc: /* Normal hook run after each command is executed, if idle.
11308 Errors running the hook are caught and ignored. */);
11309 Vpost_command_idle_hook = Qnil;
11310
11311 DEFVAR_INT ("post-command-idle-delay", &post_command_idle_delay,
11312 doc: /* Delay time before running `post-command-idle-hook'.
11313 This is measured in microseconds. */);
11314 post_command_idle_delay = 100000;
11315 11277
11316 #if 0 11278 #if 0
11317 DEFVAR_LISP ("echo-area-clear-hook", ..., 11279 DEFVAR_LISP ("echo-area-clear-hook", ...,
11318 doc: /* Normal hook run when clearing the echo area. */); 11280 doc: /* Normal hook run when clearing the echo area. */);
11319 #endif 11281 #endif