Mercurial > emacs
comparison lispref/os.texi @ 73117:43aadb7f2e64
* os.texi (Timers): Mention with-local-quit.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Mon, 25 Sep 2006 15:20:44 +0000 |
parents | ce175d3f53fd |
children | 9c30f6865f5f |
comparison
equal
deleted
inserted
replaced
73116:febee7739295 | 73117:43aadb7f2e64 |
---|---|
1384 Emacs binds @code{inhibit-quit} to @code{t} before calling the timer | 1384 Emacs binds @code{inhibit-quit} to @code{t} before calling the timer |
1385 function, because quitting out of many timer functions can leave | 1385 function, because quitting out of many timer functions can leave |
1386 things in an inconsistent state. This is normally unproblematical | 1386 things in an inconsistent state. This is normally unproblematical |
1387 because most timer functions don't do a lot of work. Indeed, for a | 1387 because most timer functions don't do a lot of work. Indeed, for a |
1388 timer to call a function that takes substantial time to run is likely | 1388 timer to call a function that takes substantial time to run is likely |
1389 to be annoying. | 1389 to be annoying. If a timer function needs to allow quitting, it |
1390 should use @code{with-local-quit} (@pxref{Quitting}). For example, if | |
1391 a timer function calls @code{accept-process-output} to receive output | |
1392 from an external process, that call should be wrapped inside | |
1393 @code{with-local-quit}, to ensure that @kbd{C-g} works if the external | |
1394 process hangs. | |
1390 | 1395 |
1391 It is usually a bad idea for timer functions to alter buffer | 1396 It is usually a bad idea for timer functions to alter buffer |
1392 contents. When they do, they usually should call @code{undo-boundary} | 1397 contents. When they do, they usually should call @code{undo-boundary} |
1393 both before and after changing the buffer, to separate the timer's | 1398 both before and after changing the buffer, to separate the timer's |
1394 changes from user commands' changes and prevent a single undo entry | 1399 changes from user commands' changes and prevent a single undo entry |