emacs-devel
[Top][All Lists]
Advanced

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

Re: undo weirdness with insert-file-contents


From: Stefan Monnier
Subject: Re: undo weirdness with insert-file-contents
Date: Sun, 02 Mar 2008 00:02:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> +   if (inserted > 0
> +       && CONSP (current_buffer->undo_list)
> +       && (! NILP (XCAR (current_buffer->undo_list))))
> +     /* Insert an undo boundary unless there's one here. */
> +     current_buffer->undo_list =
> +       Fcons (Qnil, current_buffer->undo_list);

We should use Fundo_boundary here.

> +   else if (inserted > 0
> +        && (! EQ (original_undo_list, Qt))
> +        && (NILP (visit)) && (NILP (replace)))
> +     /* Assure that the first insertion is counted as a change. */
> +     {
> +       current_buffer->undo_list = Qnil;
> +       record_first_change ();
> +     }

You use `else' between the two, but it's not clear why the two should be
mutually exclusive.  And please mention `visit' in the comment.
Also if the file is empty, is this going to mark the buffer as modified
even though nothing was changed?


        Stefan




reply via email to

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