[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 14:12:57 +0100 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> The value of buffer-undo-list is:
>
> (nil
> (10 . 21)
> (1 . 21)
> (t 0 . 0))
The (1 . 21) entry is silly and obviously breaks undoing the prior
(insert "Foo: bar\n"). Although EQ (XCAR (tem), lbeg) was not very
intelligent, setting this to (XCAR (tem) == lbeg) doesn't seem to help
either. Please try again with the attached patch.
GDB doesn't work here currently, so I can't debug this. But could you
try finding out in `insert-file-contents' (1) why the test in
if (CONSP (tem) && INTEGERP (XCAR (tem)) &&
INTEGERP (XCDR (tem)) && (XCAR (tem) == lbeg))
/* In the non-visiting case record only the final insertion. */
current_buffer->undo_list =
Fcons (Fcons (lbeg, lend), Fcdr (old_undo));
fails and (2) which value old_undo has here? Thanks in advance.
*** fileio.c.~1.602.~ Thu Feb 14 20:41:44 2008
--- fileio.c Thu Feb 28 13:59:42 2008
***************
*** 4674,4680 ****
/* Save old undo list and don't record undo for decoding. */
old_undo = current_buffer->undo_list;
- current_buffer->undo_list = Qt;
if (NILP (replace))
{
--- 4674,4679 ----
***************
*** 4768,4774 ****
{
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));
--- 4767,4773 ----
{
Lisp_Object tem = XCAR (old_undo);
if (CONSP (tem) && INTEGERP (XCAR (tem)) &&
! INTEGERP (XCDR (tem)) && (XCAR (tem) == lbeg))
/* In the non-visiting case record only the final insertion. */
current_buffer->undo_list =
Fcons (Fcons (lbeg, lend), Fcdr (old_undo));
Re: undo weirdness with insert-file-contents, Glenn Morris, 2008/02/28