Mercurial > emacs
comparison src/keyboard.c @ 83307:21eea50897a7
Merged from miles@gnu.org--gnu-2005 (patch 69, 313-319)
Patches applied:
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-313
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-314
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-315
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-316
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-317
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-318
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-319
Update from CVS
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-69
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-347
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Fri, 20 May 2005 17:44:36 +0000 |
parents | 6fef25c75847 e598462c7b22 |
children | 63b7247f4be6 |
comparison
equal
deleted
inserted
replaced
83306:8b66fddd72c5 | 83307:21eea50897a7 |
---|---|
444 | 444 |
445 /* Hooks to run before and after each command. */ | 445 /* Hooks to run before and after each command. */ |
446 Lisp_Object Qpre_command_hook, Vpre_command_hook; | 446 Lisp_Object Qpre_command_hook, Vpre_command_hook; |
447 Lisp_Object Qpost_command_hook, Vpost_command_hook; | 447 Lisp_Object Qpost_command_hook, Vpost_command_hook; |
448 Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal; | 448 Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal; |
449 /* Hook run after a command if there's no more input soon. */ | |
450 Lisp_Object Qpost_command_idle_hook, Vpost_command_idle_hook; | |
451 | |
452 /* Delay time in microseconds before running post-command-idle-hook. */ | |
453 EMACS_INT post_command_idle_delay; | |
454 | 449 |
455 /* List of deferred actions to be performed at a later time. | 450 /* List of deferred actions to be performed at a later time. |
456 The precise format isn't relevant here; we just check whether it is nil. */ | 451 The precise format isn't relevant here; we just check whether it is nil. */ |
457 Lisp_Object Vdeferred_action_list; | 452 Lisp_Object Vdeferred_action_list; |
458 | 453 |
1430 if (!NILP (echo_area_buffer[0])) | 1425 if (!NILP (echo_area_buffer[0])) |
1431 resize_echo_area_exactly (); | 1426 resize_echo_area_exactly (); |
1432 | 1427 |
1433 if (!NILP (Vdeferred_action_list)) | 1428 if (!NILP (Vdeferred_action_list)) |
1434 safe_run_hooks (Qdeferred_action_function); | 1429 safe_run_hooks (Qdeferred_action_function); |
1435 | |
1436 if (!NILP (Vpost_command_idle_hook) && !NILP (Vrun_hooks)) | |
1437 { | |
1438 if (NILP (Vunread_command_events) | |
1439 && NILP (Vunread_input_method_events) | |
1440 && NILP (Vunread_post_input_method_events) | |
1441 && NILP (Vexecuting_kbd_macro) | |
1442 && !NILP (sit_for (0, post_command_idle_delay, 0, 1, 1))) | |
1443 safe_run_hooks (Qpost_command_idle_hook); | |
1444 } | |
1445 } | 1430 } |
1446 | 1431 |
1447 Vmemory_full = Qnil; | 1432 Vmemory_full = Qnil; |
1448 | 1433 |
1449 /* Do this after running Vpost_command_hook, for consistency. */ | 1434 /* Do this after running Vpost_command_hook, for consistency. */ |
1805 resize_echo_area_exactly (); | 1790 resize_echo_area_exactly (); |
1806 | 1791 |
1807 if (!NILP (Vdeferred_action_list)) | 1792 if (!NILP (Vdeferred_action_list)) |
1808 safe_run_hooks (Qdeferred_action_function); | 1793 safe_run_hooks (Qdeferred_action_function); |
1809 | 1794 |
1810 if (!NILP (Vpost_command_idle_hook) && !NILP (Vrun_hooks)) | |
1811 { | |
1812 if (NILP (Vunread_command_events) | |
1813 && NILP (Vunread_input_method_events) | |
1814 && NILP (Vunread_post_input_method_events) | |
1815 && NILP (Vexecuting_kbd_macro) | |
1816 && !NILP (sit_for (0, post_command_idle_delay, 0, 1, 1))) | |
1817 safe_run_hooks (Qpost_command_idle_hook); | |
1818 } | |
1819 | |
1820 /* If there is a prefix argument, | 1795 /* If there is a prefix argument, |
1821 1) We don't want Vlast_command to be ``universal-argument'' | 1796 1) We don't want Vlast_command to be ``universal-argument'' |
1822 (that would be dumb), so don't set Vlast_command, | 1797 (that would be dumb), so don't set Vlast_command, |
1823 2) we want to leave echoing on so that the prefix will be | 1798 2) we want to leave echoing on so that the prefix will be |
1824 echoed as part of this key sequence, so don't call | 1799 echoed as part of this key sequence, so don't call |
1930 && display_prop_intangible_p (val) | 1905 && display_prop_intangible_p (val) |
1931 && (!OVERLAYP (overlay) | 1906 && (!OVERLAYP (overlay) |
1932 ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil) | 1907 ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil) |
1933 : (beg = OVERLAY_POSITION (OVERLAY_START (overlay)), | 1908 : (beg = OVERLAY_POSITION (OVERLAY_START (overlay)), |
1934 end = OVERLAY_POSITION (OVERLAY_END (overlay)))) | 1909 end = OVERLAY_POSITION (OVERLAY_END (overlay)))) |
1935 && beg < PT) /* && end > PT <- It's always the case. */ | 1910 && (beg < PT /* && end > PT <- It's always the case. */ |
1911 || (beg <= PT && STRINGP (val) && SCHARS (val) == 0))) | |
1936 { | 1912 { |
1937 xassert (end > PT); | 1913 xassert (end > PT); |
1938 SET_PT (PT < last_pt ? beg : end); | 1914 SET_PT (PT < last_pt |
1915 ? (STRINGP (val) && SCHARS (val) == 0 ? beg - 1 : beg) | |
1916 : end); | |
1939 check_composition = check_invisible = 1; | 1917 check_composition = check_invisible = 1; |
1940 } | 1918 } |
1941 check_display = 0; | 1919 check_display = 0; |
1942 if (check_invisible && PT > BEGV && PT < ZV) | 1920 if (check_invisible && PT > BEGV && PT < ZV) |
1943 { | 1921 { |
10985 staticpro (&Qpre_command_hook); | 10963 staticpro (&Qpre_command_hook); |
10986 | 10964 |
10987 Qpost_command_hook = intern ("post-command-hook"); | 10965 Qpost_command_hook = intern ("post-command-hook"); |
10988 staticpro (&Qpost_command_hook); | 10966 staticpro (&Qpost_command_hook); |
10989 | 10967 |
10990 Qpost_command_idle_hook = intern ("post-command-idle-hook"); | |
10991 staticpro (&Qpost_command_idle_hook); | |
10992 | |
10993 Qdeferred_action_function = intern ("deferred-action-function"); | 10968 Qdeferred_action_function = intern ("deferred-action-function"); |
10994 staticpro (&Qdeferred_action_function); | 10969 staticpro (&Qdeferred_action_function); |
10995 | 10970 |
10996 Qcommand_hook_internal = intern ("command-hook-internal"); | 10971 Qcommand_hook_internal = intern ("command-hook-internal"); |
10997 staticpro (&Qcommand_hook_internal); | 10972 staticpro (&Qcommand_hook_internal); |
11432 doc: /* Normal hook run after each command is executed. | 11407 doc: /* Normal hook run after each command is executed. |
11433 If an unhandled error happens in running this hook, | 11408 If an unhandled error happens in running this hook, |
11434 the hook value is set to nil, since otherwise the error | 11409 the hook value is set to nil, since otherwise the error |
11435 might happen repeatedly and make Emacs nonfunctional. */); | 11410 might happen repeatedly and make Emacs nonfunctional. */); |
11436 Vpost_command_hook = Qnil; | 11411 Vpost_command_hook = Qnil; |
11437 | |
11438 DEFVAR_LISP ("post-command-idle-hook", &Vpost_command_idle_hook, | |
11439 doc: /* Normal hook run after each command is executed, if idle. | |
11440 Errors running the hook are caught and ignored. */); | |
11441 Vpost_command_idle_hook = Qnil; | |
11442 | |
11443 DEFVAR_INT ("post-command-idle-delay", &post_command_idle_delay, | |
11444 doc: /* Delay time before running `post-command-idle-hook'. | |
11445 This is measured in microseconds. */); | |
11446 post_command_idle_delay = 100000; | |
11447 | 11412 |
11448 #if 0 | 11413 #if 0 |
11449 DEFVAR_LISP ("echo-area-clear-hook", ..., | 11414 DEFVAR_LISP ("echo-area-clear-hook", ..., |
11450 doc: /* Normal hook run when clearing the echo area. */); | 11415 doc: /* Normal hook run when clearing the echo area. */); |
11451 #endif | 11416 #endif |