view man/xemacs/undo.texi @ 4407:4ee73bbe4f8e

Always use boyer_moore in ASCII or Latin-1 buffers with ASCII search strings. 2007-12-26 Aidan Kehoe <kehoea@parhasard.net> * casetab.c: Extend and correct some case table documentation. * search.c (search_buffer): Correct a bug where only the first entry for a character in the case equivalence table was examined in determining if the Boyer-Moore search algorithm is appropriate. If there are case mappings outside of the charset and row of the characters specified in the search string, those case mappings can be safely ignored (and Boyer-Moore search can be used) if we know from the buffer statistics that the corresponding characters cannot occur. * search.c (boyer_moore): Assert that we haven't been passed a string with varying characters sets or rows within character sets. That's what simple_search is for. In the very rare event that a character in the search string has a canonical case mapping that is not in the same character set and row, don't try to search for the canonical character, search for some other character that is in the the desired character set and row. Assert that the case table isn't corrupt. Do not search for any character case mappings that cannot possibly occur in the buffer, given the buffer metadata about its contents.
author Aidan Kehoe <kehoea@parhasard.net>
date Wed, 26 Dec 2007 17:30:16 +0100
parents 376386a54a3c
children
line wrap: on
line source


@node Undo, Minibuffer, Basic, Top
@chapter Undoing Changes
@cindex undo
@cindex mistakes, correcting

  Emacs allows you to undo all changes you make to the text of a buffer,
up to a certain amount of change (8000 characters).  Each buffer records
changes individually, and the undo command always applies to the
current buffer.  Usually each editing command makes a separate entry
in the undo records, but some commands such as @code{query-replace}
make many entries, and very simple commands such as self-inserting
characters are often grouped to make undoing less tedious.

@table @kbd
@item C-x u
Undo one batch of changes (usually, one command's worth) (@code{undo}).
@item C-_
The same.
@end table

@kindex C-x u
@kindex C-_
@findex undo
  The command @kbd{C-x u} or @kbd{C-_} allows you to undo changes.  The
first time you give this command, it undoes the last change.  Point
moves to the text affected by the undo, so you can see what was undone.

  Consecutive repetitions of the @kbd{C-_} or @kbd{C-x u} commands undo
earlier and earlier changes, back to the limit of what has been
recorded.  If all recorded changes have already been undone, the undo
command prints an error message and does nothing.

  Any command other than an undo command breaks the sequence of undo
commands.  Starting at this moment, the previous undo commands are
considered ordinary changes that can themselves be undone.  Thus, you can
redo changes you have undone by typing @kbd{C-f} or any other command
that have no important effect, and then using more undo commands.

  If you notice that a buffer has been modified accidentally, the
easiest way to recover is to type @kbd{C-_} repeatedly until the stars
disappear from the front of the mode line.  When that happens, all the
modifications you made have been canceled.  If you do not remember
whether you changed the buffer deliberately, type @kbd{C-_} once. When
you see Emacs undo the last change you made, you probably remember why you
made it.  If the change was an accident, leave it undone.  If it was
deliberate, redo the change as described in the preceding paragraph.

  Whenever an undo command makes the stars disappear from the mode line,
the buffer contents is the same as it was when the file was last read in
or saved.

  Not all buffers record undo information.  Buffers whose names start with
spaces don't; these buffers are used internally by Emacs and its extensions
to hold text that users don't normally look at or edit.  Minibuffers,
help buffers, and documentation buffers also don't record undo information.

  Emacs can remember at most 8000 or so characters of deleted or
modified text in any one buffer for reinsertion by the undo command.
There is also a limit on the number of individual insert, delete, or
change actions that Emacs can remember.

  There are two keys to run the @code{undo} command, @kbd{C-x u} and
@kbd{C-_}, because on some keyboards, it is not obvious how to type
@kbd{C-_}. @kbd{C-x u} is an alternative you can type in the same
fashion on any terminal.