diff options
| author | Stefan Monnier | 2005-02-08 20:49:16 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-02-08 20:49:16 +0000 |
| commit | 3419757dfd171e5032b2f6bd69ce17a71800611b (patch) | |
| tree | 3a72bb8a92a42119f5237605a826a1b707befd89 | |
| parent | e7eaabae699e4e3242ca71084fbbdbf461a2e3f5 (diff) | |
| download | emacs-3419757dfd171e5032b2f6bd69ce17a71800611b.tar.gz emacs-3419757dfd171e5032b2f6bd69ce17a71800611b.zip | |
(Fprimitive_undo): Check veracity of delta,start,end.
| -rw-r--r-- | src/ChangeLog | 34 | ||||
| -rw-r--r-- | src/undo.c | 28 |
2 files changed, 40 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a2fed2f37c0..4c628e025aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2005-02-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * undo.c (Fprimitive_undo): Check veracity of delta,start,end. | ||
| 4 | |||
| 1 | 2005-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 5 | 2005-02-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 6 | ||
| 3 | * xfns.c (Fx_change_window_property): Use long array when format is 32. | 7 | * xfns.c (Fx_change_window_property): Use long array when format is 32. |
| @@ -20,7 +24,7 @@ | |||
| 20 | (Fx_send_client_event): Undo change from 2005-02-05, | 24 | (Fx_send_client_event): Undo change from 2005-02-05, |
| 21 | x_fill_property_data now handles that case. | 25 | x_fill_property_data now handles that case. |
| 22 | 26 | ||
| 23 | * xfns.c (Fx_backspace_delete_keys_p): Added comment about the | 27 | * xfns.c (Fx_backspace_delete_keys_p): Add comment about the |
| 24 | reason for the approach in the code. | 28 | reason for the approach in the code. |
| 25 | 29 | ||
| 26 | 2005-02-07 Kim F. Storm <storm@cua.dk> | 30 | 2005-02-07 Kim F. Storm <storm@cua.dk> |
| @@ -35,8 +39,7 @@ | |||
| 35 | 39 | ||
| 36 | 2005-02-05 Andreas Schwab <schwab@suse.de> | 40 | 2005-02-05 Andreas Schwab <schwab@suse.de> |
| 37 | 41 | ||
| 38 | * sysdep.c (sys_subshell): Properly terminate execlp argument | 42 | * sysdep.c (sys_subshell): Properly terminate execlp argument list. |
| 39 | list. | ||
| 40 | 43 | ||
| 41 | 2005-02-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 44 | 2005-02-05 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 42 | 45 | ||
| @@ -76,8 +79,7 @@ | |||
| 76 | 79 | ||
| 77 | * macfns.c (x_create_tip_frame): Likewise. | 80 | * macfns.c (x_create_tip_frame): Likewise. |
| 78 | 81 | ||
| 79 | * macterm.c (mac_draw_string_common, x_make_frame_visible): | 82 | * macterm.c (mac_draw_string_common, x_make_frame_visible): Likewise. |
| 80 | Likewise. | ||
| 81 | 83 | ||
| 82 | 2005-02-03 Richard M. Stallman <rms@gnu.org> | 84 | 2005-02-03 Richard M. Stallman <rms@gnu.org> |
| 83 | 85 | ||
| @@ -9955,7 +9957,7 @@ | |||
| 9955 | * search.c (Fmatch_data): Doc fix. Explicitly state that | 9957 | * search.c (Fmatch_data): Doc fix. Explicitly state that |
| 9956 | match-data is undefined if last search failed. | 9958 | match-data is undefined if last search failed. |
| 9957 | 9959 | ||
| 9958 | * keymap.c (Fcommand_remapping): Renamed from Fremap_command. | 9960 | * keymap.c (Fcommand_remapping): Rename from Fremap_command. |
| 9959 | All uses changed. | 9961 | All uses changed. |
| 9960 | 9962 | ||
| 9961 | 2003-02-12 Juanma Barranquero <lektu@terra.es> | 9963 | 2003-02-12 Juanma Barranquero <lektu@terra.es> |
| @@ -10662,7 +10664,7 @@ | |||
| 10662 | selected frame. | 10664 | selected frame. |
| 10663 | 10665 | ||
| 10664 | * keymap.c (apropos_predicate, apropos_accumulate): Make them static. | 10666 | * keymap.c (apropos_predicate, apropos_accumulate): Make them static. |
| 10665 | (syms_of_keymap): staticpro them. | 10667 | (syms_of_keymap): Staticpro them. |
| 10666 | (Fapropos_internal): Initialize them and clear them out. | 10668 | (Fapropos_internal): Initialize them and clear them out. |
| 10667 | Don't GCPRO them. | 10669 | Don't GCPRO them. |
| 10668 | 10670 | ||
| @@ -12764,9 +12766,9 @@ | |||
| 12764 | * fns.c (concat): Likewise. | 12766 | * fns.c (concat): Likewise. |
| 12765 | * lread.c (read_vector): Likewise. | 12767 | * lread.c (read_vector): Likewise. |
| 12766 | 12768 | ||
| 12767 | * lisp.h (SMBP): Deleted. All uses changed to STRING_MULTIBYTE. | 12769 | * lisp.h (SMBP): Delete. All uses changed to STRING_MULTIBYTE. |
| 12768 | (STRING_SET_UNIBYTE): New macro. | 12770 | (STRING_SET_UNIBYTE): New macro. |
| 12769 | (SET_STRING_BYTES): Deleted. Callers (all of which supplied a | 12771 | (SET_STRING_BYTES): Delete. Callers (all of which supplied a |
| 12770 | length of -1) changed to use STRING_SET_UNIBYTE. | 12772 | length of -1) changed to use STRING_SET_UNIBYTE. |
| 12771 | * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, | 12773 | * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, |
| 12772 | casefiddle.c, category.c, ccl.c, charset.c, charset.h, coding.c, | 12774 | casefiddle.c, category.c, ccl.c, charset.c, charset.h, coding.c, |
| @@ -12809,7 +12811,7 @@ | |||
| 12809 | 2002-07-11 Richard M. Stallman <rms@gnu.org> | 12811 | 2002-07-11 Richard M. Stallman <rms@gnu.org> |
| 12810 | 12812 | ||
| 12811 | * alloc.c (Vmemory_full): New variable. | 12813 | * alloc.c (Vmemory_full): New variable. |
| 12812 | (Vmemory_signal_data): Renamed from memory_signal_data. | 12814 | (Vmemory_signal_data): Rename from memory_signal_data. |
| 12813 | Uses changed. | 12815 | Uses changed. |
| 12814 | (syms_of_alloc): Defvar them. | 12816 | (syms_of_alloc): Defvar them. |
| 12815 | (memory_full, buffer_memory_full): Set Vmemory_full. | 12817 | (memory_full, buffer_memory_full): Set Vmemory_full. |
| @@ -12827,7 +12829,7 @@ | |||
| 12827 | (reseat_at_next_visible_line_start, next_element_from_buffer): | 12829 | (reseat_at_next_visible_line_start, next_element_from_buffer): |
| 12828 | Use `double', not `float', when calling indented_beyond_p. | 12830 | Use `double', not `float', when calling indented_beyond_p. |
| 12829 | 12831 | ||
| 12830 | * s/hpux11.h (BROKEN_SA_RESTART): Defined. | 12832 | * s/hpux11.h (BROKEN_SA_RESTART): Define. |
| 12831 | 12833 | ||
| 12832 | * sysdep.c (sys_signal): Test BROKEN_SA_RESTART. | 12834 | * sysdep.c (sys_signal): Test BROKEN_SA_RESTART. |
| 12833 | 12835 | ||
| @@ -13585,7 +13587,7 @@ | |||
| 13585 | 13587 | ||
| 13586 | 2002-05-11 Kim F. Storm <storm@cua.dk> | 13588 | 2002-05-11 Kim F. Storm <storm@cua.dk> |
| 13587 | 13589 | ||
| 13588 | * keymap.c (current_minor_maps): Fixed resizing of cmm_maps; | 13590 | * keymap.c (current_minor_maps): Fix resizing of cmm_maps; |
| 13589 | only update cmm_size if realloc actually succeeds. | 13591 | only update cmm_size if realloc actually succeeds. |
| 13590 | Testing with initial size of 2 elements revealed that using | 13592 | Testing with initial size of 2 elements revealed that using |
| 13591 | realloc on GNU/Linux would cause a random trap in xmalloc | 13593 | realloc on GNU/Linux would cause a random trap in xmalloc |
| @@ -14824,7 +14826,7 @@ | |||
| 14824 | 14826 | ||
| 14825 | 2002-02-24 Kim F. Storm <storm@cua.dk> | 14827 | 2002-02-24 Kim F. Storm <storm@cua.dk> |
| 14826 | 14828 | ||
| 14827 | * keymap.c (Flookup_key): Fixed problem in 2001-12-28 patch: | 14829 | * keymap.c (Flookup_key): Fix problem in 2001-12-28 patch: |
| 14828 | The validation of the event type was too strict as it didn't | 14830 | The validation of the event type was too strict as it didn't |
| 14829 | allow string events; buffer names are used in bindings for | 14831 | allow string events; buffer names are used in bindings for |
| 14830 | menu-bar-select-buffer (see `menu-bar-update-buffers'). | 14832 | menu-bar-select-buffer (see `menu-bar-update-buffers'). |
| @@ -14837,7 +14839,7 @@ | |||
| 14837 | prefix in the keymaps, i.e. [remap COMMAND]. | 14839 | prefix in the keymaps, i.e. [remap COMMAND]. |
| 14838 | 14840 | ||
| 14839 | * keymap.c (Qremap, remap_command_vector): New variables. | 14841 | * keymap.c (Qremap, remap_command_vector): New variables. |
| 14840 | (is_command_symbol): Removed function. | 14842 | (is_command_symbol): Remove function. |
| 14841 | (Fdefine_key): No longer accept a symbol for KEY. | 14843 | (Fdefine_key): No longer accept a symbol for KEY. |
| 14842 | Added validation of [remap COMMAND] argument for KEY. | 14844 | Added validation of [remap COMMAND] argument for KEY. |
| 14843 | The DEF is no longer required to be a symbol when remapping a command. | 14845 | The DEF is no longer required to be a symbol when remapping a command. |
| @@ -15195,7 +15197,7 @@ | |||
| 15195 | Doc updated. Callers changed. Pass arg to where_is_internal. | 15197 | Doc updated. Callers changed. Pass arg to where_is_internal. |
| 15196 | 15198 | ||
| 15197 | * keymap.h (Fkey_binding, Fwhere_is_internal): Update prototype. | 15199 | * keymap.h (Fkey_binding, Fwhere_is_internal): Update prototype. |
| 15198 | (is_command_symbol): Added prototype. | 15200 | (is_command_symbol): Add prototype. |
| 15199 | 15201 | ||
| 15200 | * keyboard.c (Vthis_original_command): New variable. | 15202 | * keyboard.c (Vthis_original_command): New variable. |
| 15201 | (syms_of_keyboard): DEFVAR_LISP it. | 15203 | (syms_of_keyboard): DEFVAR_LISP it. |
| @@ -15612,7 +15614,7 @@ | |||
| 15612 | 15614 | ||
| 15613 | 2002-01-03 Kim F. Storm <storm@cua.dk> | 15615 | 2002-01-03 Kim F. Storm <storm@cua.dk> |
| 15614 | 15616 | ||
| 15615 | * keyboard.c (read_key_sequence): Fixed cast of submaps arg to bcopy. | 15617 | * keyboard.c (read_key_sequence): Fix cast of submaps arg to bcopy. |
| 15616 | 15618 | ||
| 15617 | 2002-01-02 Richard M. Stallman <rms@gnu.org> | 15619 | 2002-01-02 Richard M. Stallman <rms@gnu.org> |
| 15618 | 15620 | ||
diff --git a/src/undo.c b/src/undo.c index 5483060eb48..86237e2c59a 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -556,16 +556,32 @@ Return what remains of the list. */) | |||
| 556 | } | 556 | } |
| 557 | else if (EQ (car, Qapply)) | 557 | else if (EQ (car, Qapply)) |
| 558 | { | 558 | { |
| 559 | /* Element (apply FUNNAME . ARGS) means call FUNNAME to undo. */ | 559 | /* Element (apply FUN . ARGS) means call FUN to undo. */ |
| 560 | car = Fcar (cdr); | 560 | car = Fcar (cdr); |
| 561 | cdr = Fcdr (cdr); | ||
| 561 | if (INTEGERP (car)) | 562 | if (INTEGERP (car)) |
| 562 | { | 563 | { |
| 563 | /* Long format: (apply DELTA START END FUNNAME . ARGS). */ | 564 | /* Long format: (apply DELTA START END FUN . ARGS). */ |
| 564 | cdr = Fcdr (Fcdr (Fcdr (cdr))); | 565 | Lisp_Object delta = car; |
| 565 | car = Fcar (cdr); | 566 | Lisp_Object start = Fcar (cdr); |
| 567 | Lisp_Object end = Fcar (Fcdr (cdr)); | ||
| 568 | Lisp_Object start_mark = Fcopy_marker (start, Qnil); | ||
| 569 | Lisp_Object end_mark = Fcopy_marker (end, Qt); | ||
| 570 | |||
| 571 | cdr = Fcdr (Fcdr (cdr)); | ||
| 572 | apply1 (Fcar (cdr), Fcdr (cdr)); | ||
| 573 | |||
| 574 | /* Check that the function did what the entry said it | ||
| 575 | would do. */ | ||
| 576 | if (!EQ (start, Fmarker_position (start_mark)) | ||
| 577 | || (XINT (delta) + XINT (end) | ||
| 578 | != marker_position (end_mark))) | ||
| 579 | error ("Changes to be undone by function different than announced"); | ||
| 580 | Fset_marker (start_mark, Qnil, Qnil); | ||
| 581 | Fset_marker (end_mark, Qnil, Qnil); | ||
| 566 | } | 582 | } |
| 567 | cdr = Fcdr (cdr); | 583 | else |
| 568 | apply1 (car, cdr); | 584 | apply1 (car, cdr); |
| 569 | did_apply = 1; | 585 | did_apply = 1; |
| 570 | } | 586 | } |
| 571 | else if (STRINGP (car) && INTEGERP (cdr)) | 587 | else if (STRINGP (car) && INTEGERP (cdr)) |