diff options
| author | Artur Malabarba | 2015-10-25 14:34:18 +0000 |
|---|---|---|
| committer | Artur Malabarba | 2015-10-25 14:39:07 +0000 |
| commit | 12941b99d16835b5de3f065545ebe6a0835a1d0f (patch) | |
| tree | 69dbf7a84d6c47b142df44ba21ecb5ac0cfb4f79 /src | |
| parent | 2a85bf6a8e27dafd1005505a43cf9c4aff0957ea (diff) | |
| download | emacs-12941b99d16835b5de3f065545ebe6a0835a1d0f.tar.gz emacs-12941b99d16835b5de3f065545ebe6a0835a1d0f.zip | |
* src/keyboard.c (post-command-hook): Extend the docstring
Mainly, explain how to use it without hanging Emacs, or giving the
impression that it is hanging. Also mention `pre-command-hook'.
(pre-command-hook): Mention `post-command-hook'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 1a78f6a705c..4ea0f97e77f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -11374,14 +11374,26 @@ Buffer modification stores t in this variable. */); | |||
| 11374 | doc: /* Normal hook run before each command is executed. | 11374 | doc: /* Normal hook run before each command is executed. |
| 11375 | If an unhandled error happens in running this hook, | 11375 | If an unhandled error happens in running this hook, |
| 11376 | the function in which the error occurred is unconditionally removed, since | 11376 | the function in which the error occurred is unconditionally removed, since |
| 11377 | otherwise the error might happen repeatedly and make Emacs nonfunctional. */); | 11377 | otherwise the error might happen repeatedly and make Emacs nonfunctional. |
| 11378 | |||
| 11379 | See also `pre-command-hook'. */); | ||
| 11378 | Vpre_command_hook = Qnil; | 11380 | Vpre_command_hook = Qnil; |
| 11379 | 11381 | ||
| 11380 | DEFVAR_LISP ("post-command-hook", Vpost_command_hook, | 11382 | DEFVAR_LISP ("post-command-hook", Vpost_command_hook, |
| 11381 | doc: /* Normal hook run after each command is executed. | 11383 | doc: /* Normal hook run after each command is executed. |
| 11382 | If an unhandled error happens in running this hook, | 11384 | If an unhandled error happens in running this hook, |
| 11383 | the function in which the error occurred is unconditionally removed, since | 11385 | the function in which the error occurred is unconditionally removed, since |
| 11384 | otherwise the error might happen repeatedly and make Emacs nonfunctional. */); | 11386 | otherwise the error might happen repeatedly and make Emacs nonfunctional. |
| 11387 | |||
| 11388 | It is usually a bad idea to use this hook for expensive processing. | ||
| 11389 | If unavoidable, `while-no-input' can be used avoid making Emacs | ||
| 11390 | unresponsive while the user types. Furthermore, this hook is run | ||
| 11391 | before redisplay, so the effect of the executed command won't be | ||
| 11392 | displayed on the buffer until after the hook has finished (giving the | ||
| 11393 | impression that Emacs is hanging). You can call `redisplay' inside | ||
| 11394 | `while-no-input' to avoid this. | ||
| 11395 | |||
| 11396 | See also `pre-command-hook'. */); | ||
| 11385 | Vpost_command_hook = Qnil; | 11397 | Vpost_command_hook = Qnil; |
| 11386 | 11398 | ||
| 11387 | #if 0 | 11399 | #if 0 |