diff options
| author | Phillip Lord | 2015-11-24 23:02:11 +0000 |
|---|---|---|
| committer | Phillip Lord | 2015-11-30 20:14:13 +0000 |
| commit | c2ba4a20aafc3ea0a907bcbb17fb41590b44cf09 (patch) | |
| tree | f3f7e6be7a8ab5be5f7d5fb7f689b26685b07e38 /doc/lispref | |
| parent | 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a (diff) | |
| download | emacs-c2ba4a20aafc3ea0a907bcbb17fb41590b44cf09.tar.gz emacs-c2ba4a20aafc3ea0a907bcbb17fb41590b44cf09.zip | |
; Added documentation for undo-auto functionality.
* doc/lispref/text.texi: Documentation added
* etc/NEWS: Annoucement added
* lisp/simple.el (undo-auto--amalgamate): Docstring fix.
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/text.texi | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 6d9d26f0ad1..2ceb3529689 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -1343,27 +1343,38 @@ This function places a boundary element in the undo list. The undo | |||
| 1343 | command stops at such a boundary, and successive undo commands undo | 1343 | command stops at such a boundary, and successive undo commands undo |
| 1344 | to earlier and earlier boundaries. This function returns @code{nil}. | 1344 | to earlier and earlier boundaries. This function returns @code{nil}. |
| 1345 | 1345 | ||
| 1346 | The editor command loop automatically calls @code{undo-boundary} just | ||
| 1347 | before executing each key sequence, so that each undo normally undoes | ||
| 1348 | the effects of one command. As an exception, the command | ||
| 1349 | @code{self-insert-command}, which produces self-inserting input | ||
| 1350 | characters (@pxref{Commands for Insertion}), may remove the boundary | ||
| 1351 | inserted by the command loop: a boundary is accepted for the first | ||
| 1352 | such character, the next 19 consecutive self-inserting input | ||
| 1353 | characters do not have boundaries, and then the 20th does; and so on | ||
| 1354 | as long as the self-inserting characters continue. Hence, sequences | ||
| 1355 | of consecutive character insertions can be undone as a group. | ||
| 1356 | |||
| 1357 | All buffer modifications add a boundary whenever the previous undoable | ||
| 1358 | change was made in some other buffer. This is to ensure that | ||
| 1359 | each command makes a boundary in each buffer where it makes changes. | ||
| 1360 | |||
| 1361 | Calling this function explicitly is useful for splitting the effects of | 1346 | Calling this function explicitly is useful for splitting the effects of |
| 1362 | a command into more than one unit. For example, @code{query-replace} | 1347 | a command into more than one unit. For example, @code{query-replace} |
| 1363 | calls @code{undo-boundary} after each replacement, so that the user can | 1348 | calls @code{undo-boundary} after each replacement, so that the user can |
| 1364 | undo individual replacements one by one. | 1349 | undo individual replacements one by one. |
| 1350 | |||
| 1351 | Mostly, however, this function is called automatically at an | ||
| 1352 | appropriate time. | ||
| 1365 | @end defun | 1353 | @end defun |
| 1366 | 1354 | ||
| 1355 | @defun undo-auto--amalgamate | ||
| 1356 | The editor command loop automatically calls @code{undo-boundary} just | ||
| 1357 | before executing each key sequence, so that each undo normally undoes | ||
| 1358 | the effects of one command. A few exceptional commands are | ||
| 1359 | @emph{amalgamating}: these commands generally cause small changes to | ||
| 1360 | buffers. So with these a boundary is inserted only every 20th command, | ||
| 1361 | so that these can be undone as a group. By default commands | ||
| 1362 | @code{self-insert-command}, which produces self-inserting input | ||
| 1363 | characters (@pxref{Commands for Insertion}), and @code{delete-char} | ||
| 1364 | which deletes characters (@pxref{Deleting Text}) are amalgamating. | ||
| 1365 | Where a command affects the contents of several buffers as may happen, | ||
| 1366 | for example, if a function on the @code{post-command-hook} affects a | ||
| 1367 | buffer other than the @code{current-buffer}, then @code{undo-boundary} | ||
| 1368 | will be called in each of them. | ||
| 1369 | @end defun | ||
| 1370 | |||
| 1371 | @defvar undo-auto--boundary-timer | ||
| 1372 | Some buffers, such as process buffers, can change even when no | ||
| 1373 | commands are executing. In these cases, @code{undo-boundary} is | ||
| 1374 | normally called periodically by the timer in this variable. Setting | ||
| 1375 | this variable to non-@code{nil} prevents this behaviour. | ||
| 1376 | @end defvar | ||
| 1377 | |||
| 1367 | @defvar undo-in-progress | 1378 | @defvar undo-in-progress |
| 1368 | This variable is normally @code{nil}, but the undo commands bind it to | 1379 | This variable is normally @code{nil}, but the undo commands bind it to |
| 1369 | @code{t}. This is so that various kinds of change hooks can tell when | 1380 | @code{t}. This is so that various kinds of change hooks can tell when |