scratch/undo-apply ae89b15a0ad 2/2: Document the new undo-list entry kind
Helmut Eller <[email protected]>
| Newsgroups | gmane.emacs.diffs |
|---|---|
| Message-ID | <[email protected]> |
branch: scratch/undo-apply commit ae89b15a0ad16ed426bec4928eb2c6722d43f015 Author: Helmut Eller <[email protected]> Commit: Helmut Eller <[email protected]> Document the new undo-list entry kind * src/buffer.c (buffer-undo-list): Update the docstring. * doc/lispref/text.texi (buffer-undo-list): Describe the new entry kind. --- doc/lispref/text.texi | 7 +++++++ src/buffer.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index db2410fbf30..68f9a80b5d3 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1449,6 +1449,13 @@ arguments @var{args}. This kind of element enables undo limited to a region to determine whether the element pertains to that region. +@item (apply @var{delta} (@var{beg} . @var{end}) @var{funname} . @var{args}) +This kind of element is similar to the previous form. The difference is +that @var{funname} is invoked with @w{@code{(apply @var{funname} +@var{beg2} @var{end2} @var{args})}}, where @var{beg2} and @var{end2} are +the adjusted values of @var{beg} and @var{end}. The function can use +those arguments to compute positions relative to the adjusted region. + @item nil This element is a boundary. The elements between two boundaries are called a @dfn{change group}; normally, each change group corresponds to diff --git a/src/buffer.c b/src/buffer.c index 0a2bff27c11..e302117b1bc 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5761,6 +5761,12 @@ in the active region. BEG and END is the range affected by this entry and DELTA is the number of characters added or deleted in that range by this change. +An entry (apply DELTA (BEG . END) FUN-NAME . ARGS) is similar to the +previous kind. The difference is that Emacs invokes FUN-NAME with +\(apply FUN-NAME BEG2 END2 ARGS), where BEG2 and END2 are the adjusted +values of BEG and END. The function can use those arguments to compute +positions relative to the adjusted region. + An entry (MARKER . DISTANCE) indicates that the marker MARKER was adjusted in position by the offset DISTANCE (an integer).