emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: question about markers, replace-match, and undo


From: Drew Adams
Subject: RE: question about markers, replace-match, and undo
Date: Fri, 27 Apr 2007 21:13:22 -0700

> That is definitely a bug.  Does this fix it?

I cannot tell; I don't build from C sources. If someone else could have a
look, that would be great. Thanks.

> *** insdel.c  02 Mar 2007 03:28:13 -0500      1.190
> --- insdel.c  27 Apr 2007 23:55:23 -0400
> ***************
> *** 1603,1610 ****
>
>     if (! EQ (current_buffer->undo_list, Qt))
>       {
>         record_delete (from, deletion);
> -       record_insert (from, inschars);
>       }
>
>     GAP_SIZE -= outgoing_insbytes;
> --- 1603,1614 ----
>
>     if (! EQ (current_buffer->undo_list, Qt))
>       {
> +       /* Record the insertion first, so that when we undo,
> +      the deletion will be undone first.  Thus, undo
> +      will insert before deleting, and thus will keep
> +      the markers before and after this text separate.  */
> +       record_insert (from + SCHARS (deletion), inschars);
>         record_delete (from, deletion);
>       }
>
>     GAP_SIZE -= outgoing_insbytes;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]