[Top][All Lists]

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

Re: undo weirdness with insert-file-contents

From: martin rudalics
Subject: Re: undo weirdness with insert-file-contents
Date: Thu, 28 Feb 2008 23:20:11 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> (progn
>   (pop-to-buffer "foo")
>   (insert-file-contents "/etc/issue")
>   (goto-char (point-max))
>   (insert-file-contents "/etc/issue"))
> M-x undo
> now works in both 22 and 23, but in 22 the buffer is marked as not
> modified after undo. It 23 it is marked as modified.

... which is wrong, obviously.

Could you try to debug `insert-file-contents' around the lines 4768-4779
of fileio.c

              Lisp_Object tem = XCAR (old_undo);
              if (CONSP (tem) && INTEGERP (XCAR (tem)) &&
                  INTEGERP (XCDR (tem)) && EQ (XCAR (tem), lbeg))
                /* In the non-visiting case record only the final insertion. */
                current_buffer->undo_list =
                  Fcons (Fcons (lbeg, lend), Fcdr (old_undo));
        /* If undo_list was Qt before, keep it that way.
           Otherwise start with an empty undo_list. */
        current_buffer->undo_list = EQ (old_undo, Qt) ? Qt : Qnil;

to see where the (t 0 . 0) entry gets removed?  Sorry but I currently
can't debug that myself.

reply via email to

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