Commit 51422d6d authored by Chong Yidong's avatar Chong Yidong
Browse files

Clarify command loop's role in undo boundary (Bug#2433).

* text.texi (Undo): Clarify command loop behavior (Bug#2433).
* commands.texi (Command Overview): Mention undo-boundary call.
parent 62e034c2
2010-06-24 Chong Yidong <cyd@stupidchicken.com>
* text.texi (Undo): Clarify command loop behavior (Bug#2433).
* commands.texi (Command Overview): Mention undo-boundary call.
2010-06-23 Glenn Morris <rgm@gnu.org> 2010-06-23 Glenn Morris <rgm@gnu.org>
* abbrevs.texi, commands.texi, compile.texi, debugging.texi: * abbrevs.texi, commands.texi, compile.texi, debugging.texi:
......
...@@ -53,16 +53,19 @@ function. If the key is @kbd{M-x}, then it reads the name of another ...@@ -53,16 +53,19 @@ function. If the key is @kbd{M-x}, then it reads the name of another
command, which it then calls. This is done by the command command, which it then calls. This is done by the command
@code{execute-extended-command} (@pxref{Interactive Call}). @code{execute-extended-command} (@pxref{Interactive Call}).
To execute a command requires first reading the arguments for it. Prior to executing the command, Emacs runs @code{undo-boundary} to
This is done by calling @code{command-execute} (@pxref{Interactive create an undo boundary. @xref{Maintaining Undo}.
Call}). For commands written in Lisp, the @code{interactive}
specification says how to read the arguments. This may use the prefix To execute a command, Emacs first reads its arguments by calling
argument (@pxref{Prefix Command Arguments}) or may read with prompting @code{command-execute} (@pxref{Interactive Call}). For commands
in the minibuffer (@pxref{Minibuffers}). For example, the command written in Lisp, the @code{interactive} specification says how to read
@code{find-file} has an @code{interactive} specification which says to the arguments. This may use the prefix argument (@pxref{Prefix
read a file name using the minibuffer. The command's function body does Command Arguments}) or may read with prompting in the minibuffer
not use the minibuffer; if you call this command from Lisp code as a (@pxref{Minibuffers}). For example, the command @code{find-file} has
function, you must supply the file name string as an ordinary Lisp an @code{interactive} specification which says to read a file name
using the minibuffer. The function body of @code{find-file} does not
use the minibuffer, so if you call @code{find-file} as a function from
Lisp code, you must supply the file name string as an ordinary Lisp
function argument. function argument.
If the command is a string or vector (i.e., a keyboard macro) then If the command is a string or vector (i.e., a keyboard macro) then
......
...@@ -1299,13 +1299,16 @@ This function places a boundary element in the undo list. The undo ...@@ -1299,13 +1299,16 @@ This function places a boundary element in the undo list. The undo
command stops at such a boundary, and successive undo commands undo command stops at such a boundary, and successive undo commands undo
to earlier and earlier boundaries. This function returns @code{nil}. to earlier and earlier boundaries. This function returns @code{nil}.
The editor command loop automatically creates an undo boundary before The editor command loop automatically calls @code{undo-boundary} just
each key sequence is executed. Thus, each undo normally undoes the before executing each key sequence, so that each undo normally undoes
effects of one command. Self-inserting input characters are an the effects of one command. As an exception, the command
exception. The command loop makes a boundary for the first such @code{self-insert-command}, which produces self-inserting input
character; the next 19 consecutive self-inserting input characters do characters (@pxref{Commands for Insertion}), may remove the boundary
not make boundaries, and then the 20th does, and so on as long as inserted by the command loop: a boundary is accepted for the first
self-inserting characters continue. such character, the next 19 consecutive self-inserting input
characters do not have boundaries, and then the 20th does; and so on
as long as the self-inserting characters continue. Hence, sequences
of consecutive character insertions can be undone as a group.
All buffer modifications add a boundary whenever the previous undoable All buffer modifications add a boundary whenever the previous undoable
change was made in some other buffer. This is to ensure that change was made in some other buffer. This is to ensure that
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment