Mercurial > hg > xemacs-beta
annotate man/xemacs/undo.texi @ 4995:8431b52e43b1
Move the various map* functions to C; add #'map-into.
src/ChangeLog addition:
2010-01-31 Aidan Kehoe <kehoea@parhasard.net>
Move #'mapcar*, #'mapcan, #'mapc, #'map, #'mapl, #'mapcon to C;
extend #'mapvector, #'mapconcat, #'mapcar to support more
SEQUENCES; have them all error with circular lists.
* fns.c (Fsubseq): Call CHECK_SEQUENCE here; Flength can return
from the debugger if it errors with a non-sequence, leading to a
crash in Fsubseq if sequence really is *not* a sequence.
(mapcarX): Rename mapcar1 to mapcarX; rework it comprehensively to
take an optional lisp output argument, and a varying number of
sequences.
Special-case a single list argument, as we used to, saving its
elements in the stack space for the results before calling
FUNCTION, so FUNCTION can corrupt the list all it
wants. dead_wrong_type_argument() in the other cases if we
encounter a non-cons where we expected a cons.
(Fmapconcat):
Accept further SEQUENCES after separator here. Special-case
the idiom (mapconcat 'identity SEQUENCE), don't even funcall.
(FmapcarX): Rename this from Fmapcar. Accept optional SEQUENCES.
(Fmapvector): Accept optional SEQUENCES.
(Fmapcan, Fmapc, Fmap): Move these here from cl-extra.el.
(Fmap_into): New function, as specified by Common Lisp.
(maplist): New function, the guts of the implementation of
Fmaplist and Fmapl.
(Fmaplist, Fmapl, Fmapcon): Move these from cl-extra.el.
(syms_of_fns):
Add a few needed symbols here, for the type tests
used by #'map. Add the new subrs, with aliases for #'mapc-internal
and #'mapcar.
* general-slots.h: Declare Qcoerce here, now it's used in both
indent.c and fns.c
* indent.c (syms_of_indent): Qcoerce is gone from here.
* lisp.h: Add ARRAYP(), SEQUENCEP(), and the corresponding CHECK_*
macros. Declare Fbit_vector, Fstring, FmapcarX, now other files
need to use them.
* data.c (Farrayp, Fsequencep): Use ARRAYP and SEQUENCEP, just
added to lisp.h
* buffer.c (Fbuffer_list): Now Fmapcar has been renamed FmapcarX
and takes MANY arguments, update this function to reflect that.
lisp/ChangeLog addition:
2010-01-31 Aidan Kehoe <kehoea@parhasard.net>
* cl.el (mapcar*): Delete; this is now in fns.c.
Use #'mapc, not #'mapc-internal in a couple of places.
* cl-macs.el (mapc, mapcar*, map): Delete these compiler macros
now the corresponding functions are in fns.c; there's no run-time
advantage to the macros.
* cl-extra.el (coerce): Extend the possible conversions here a
little; it's not remotely comprehensive yet, though it does allow
running slightly more Common Lisp code than previously.
(cl-mapcar-many): Delete.
(map, maplist, mapc, mapl, mapcan, mapcon): Move these to fns.c.
* bytecomp.el (byte-compile-maybe-mapc):
Use #'mapc itself, not #'mapc-internal, now the former is in C.
(mapcar*): Use #'byte-compile-maybe-mapc as this function's
byte-compile method, now a #'mapc that can take more than one
sequence is in C.
* obsolete.el (cl-mapc): Move this compatibility alias to this file.
* update-elc.el (do-autoload-commands): Use #'mapc, not
#'mapc-internal here.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 31 Jan 2010 18:29:48 +0000 |
parents | 376386a54a3c |
children |
rev | line source |
---|---|
0 | 1 |
2 @node Undo, Minibuffer, Basic, Top | |
3 @chapter Undoing Changes | |
4 @cindex undo | |
5 @cindex mistakes, correcting | |
6 | |
7 Emacs allows you to undo all changes you make to the text of a buffer, | |
8 up to a certain amount of change (8000 characters). Each buffer records | |
9 changes individually, and the undo command always applies to the | |
10 current buffer. Usually each editing command makes a separate entry | |
11 in the undo records, but some commands such as @code{query-replace} | |
12 make many entries, and very simple commands such as self-inserting | |
13 characters are often grouped to make undoing less tedious. | |
14 | |
15 @table @kbd | |
16 @item C-x u | |
17 Undo one batch of changes (usually, one command's worth) (@code{undo}). | |
18 @item C-_ | |
19 The same. | |
20 @end table | |
21 | |
22 @kindex C-x u | |
23 @kindex C-_ | |
24 @findex undo | |
25 The command @kbd{C-x u} or @kbd{C-_} allows you to undo changes. The | |
26 first time you give this command, it undoes the last change. Point | |
27 moves to the text affected by the undo, so you can see what was undone. | |
28 | |
29 Consecutive repetitions of the @kbd{C-_} or @kbd{C-x u} commands undo | |
30 earlier and earlier changes, back to the limit of what has been | |
31 recorded. If all recorded changes have already been undone, the undo | |
32 command prints an error message and does nothing. | |
33 | |
34 Any command other than an undo command breaks the sequence of undo | |
35 commands. Starting at this moment, the previous undo commands are | |
36 considered ordinary changes that can themselves be undone. Thus, you can | |
37 redo changes you have undone by typing @kbd{C-f} or any other command | |
38 that have no important effect, and then using more undo commands. | |
39 | |
40 If you notice that a buffer has been modified accidentally, the | |
41 easiest way to recover is to type @kbd{C-_} repeatedly until the stars | |
42 disappear from the front of the mode line. When that happens, all the | |
43 modifications you made have been canceled. If you do not remember | |
44 whether you changed the buffer deliberately, type @kbd{C-_} once. When | |
45 you see Emacs undo the last change you made, you probably remember why you | |
46 made it. If the change was an accident, leave it undone. If it was | |
47 deliberate, redo the change as described in the preceding paragraph. | |
48 | |
49 Whenever an undo command makes the stars disappear from the mode line, | |
50 the buffer contents is the same as it was when the file was last read in | |
51 or saved. | |
52 | |
53 Not all buffers record undo information. Buffers whose names start with | |
54 spaces don't; these buffers are used internally by Emacs and its extensions | |
55 to hold text that users don't normally look at or edit. Minibuffers, | |
56 help buffers, and documentation buffers also don't record undo information. | |
57 | |
58 Emacs can remember at most 8000 or so characters of deleted or | |
59 modified text in any one buffer for reinsertion by the undo command. | |
60 There is also a limit on the number of individual insert, delete, or | |
61 change actions that Emacs can remember. | |
62 | |
63 There are two keys to run the @code{undo} command, @kbd{C-x u} and | |
64 @kbd{C-_}, because on some keyboards, it is not obvious how to type | |
65 @kbd{C-_}. @kbd{C-x u} is an alternative you can type in the same | |
66 fashion on any terminal. |