diff options
| author | Barry O'Reilly | 2014-03-24 22:47:39 -0400 |
|---|---|---|
| committer | Barry O'Reilly | 2014-03-24 22:47:39 -0400 |
| commit | 37ea8275f7faad1192ddaba9f4a0789580675e17 (patch) | |
| tree | cb6242b0298180f32d8c253c1b3aa8af3c6572fa /src/lisp.h | |
| parent | 3e2377ce2f4eeb141ffbd000723c55813f78b08f (diff) | |
| download | emacs-37ea8275f7faad1192ddaba9f4a0789580675e17.tar.gz emacs-37ea8275f7faad1192ddaba9f4a0789580675e17.zip | |
Undo in region after markers in undo history relocated
* simple.el (primitive-undo): Only process marker adjustments
validated against their corresponding (TEXT . POS). Issue warning
for lone marker adjustments in undo history. (Bug#16818)
(undo-make-selective-list): Add marker adjustments to selective
undo list based on whether their corresponding (TEXT . POS) is in
the region. Remove variable adjusted-markers, which was unused
and only non nil during undo-make-selective-list.
(undo-elt-in-region): Return nil when passed a marker adjustment
and explain in function doc.
Have (MARKER . ADJUSTMENT) undo records always be immediately
after their corresponding (TEXT . POS) record in undo list.
(Bug#16818)
* lisp.h (record-delete): New arg record_markers.
(record_marker_adjustment): No longer needed outside undo.c.
* insdel.c (adjust_markers_for_delete): Move calculation of marker
adjustments to undo.c's record_marker_adjustments. Note that
fileio.c's decide_coding_unwind is another caller to
adjust_markers_for_delete. Because it has undo list bound to t,
it does not rely on adjust_markers_for_delete to record marker
adjustments.
(del_range_2): Swap call to record_delete and
adjust_markers_for_delete so as undo marker adjustments are
recorded before current deletion's adjustments, as before.
(adjust_after_replace):
(replace_range): Pass value for new record_markers arg to
delete_record.
* undo.c (record_marker_adjustment): Renamed to
record_marker_adjustments and made static.
(record_delete): Check record_markers arg and call
record_marker_adjustments.
(record_change): Pass value for new record_markers arg to
delete_record.
(record_point): at_boundary calculation no longer needs to account
for marker adjustments.
* undo-tests.el (undo-test-marker-adjustment-nominal):
(undo-test-region-t-marker): New tests of marker adjustments.
(undo-test-marker-adjustment-moved):
(undo-test-region-mark-adjustment): New tests to demonstrate
bug#16818, which fail without the fix.
* markers.texi (Moving Marker Positions): The 2014-03-02 doc
change mentioning undo's inability to handle relocated markers no
longer applies. See bug#16818.
* text.texi (Undo): Expand documentation of (TEXT . POS) and
(MARKER . ADJUSTMENT) undo elements.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lisp.h b/src/lisp.h index 2f9a30fdfe9..30f52b9070c 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4198,9 +4198,8 @@ extern void syms_of_macros (void); | |||
| 4198 | extern Lisp_Object Qapply; | 4198 | extern Lisp_Object Qapply; |
| 4199 | extern Lisp_Object Qinhibit_read_only; | 4199 | extern Lisp_Object Qinhibit_read_only; |
| 4200 | extern void truncate_undo_list (struct buffer *); | 4200 | extern void truncate_undo_list (struct buffer *); |
| 4201 | extern void record_marker_adjustment (Lisp_Object, ptrdiff_t); | ||
| 4202 | extern void record_insert (ptrdiff_t, ptrdiff_t); | 4201 | extern void record_insert (ptrdiff_t, ptrdiff_t); |
| 4203 | extern void record_delete (ptrdiff_t, Lisp_Object); | 4202 | extern void record_delete (ptrdiff_t, Lisp_Object, bool); |
| 4204 | extern void record_first_change (void); | 4203 | extern void record_first_change (void); |
| 4205 | extern void record_change (ptrdiff_t, ptrdiff_t); | 4204 | extern void record_change (ptrdiff_t, ptrdiff_t); |
| 4206 | extern void record_property_change (ptrdiff_t, ptrdiff_t, | 4205 | extern void record_property_change (ptrdiff_t, ptrdiff_t, |