all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Miles Bader <miles@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: undo weirdness with insert-file-contents
Date: Thu, 28 Feb 2008 14:12:57 +0100	[thread overview]
Message-ID: <47C6B359.10302@gmx.at> (raw)
In-Reply-To: <buor6exjqeo.fsf@dhapc248.dev.necel.com>

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

 > 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.

[-- Attachment #2: fileio.patch --]
[-- Type: text/plain, Size: 1008 bytes --]

*** 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));

  reply	other threads:[~2008-02-28 13:12 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-28  7:46 undo weirdness with insert-file-contents Miles Bader
2008-02-28  9:56 ` martin rudalics
2008-02-28 11:01   ` Miles Bader
2008-02-28 13:12     ` martin rudalics [this message]
2008-02-28 16:52       ` Stefan Monnier
2008-02-28 19:31         ` martin rudalics
2008-02-28 20:01           ` Miles Bader
2008-02-28 22:19             ` martin rudalics
2008-02-28 21:35           ` Stefan Monnier
2008-02-28 22:21             ` martin rudalics
2008-02-28 17:45 ` Glenn Morris
2008-02-28 19:35   ` martin rudalics
2008-02-28 20:28     ` Glenn Morris
2008-02-28 22:20       ` martin rudalics
2008-02-29 22:42       ` martin rudalics
2008-03-02  5:02         ` Stefan Monnier
2008-03-02 12:44           ` martin rudalics
2008-03-02 19:07             ` Stefan Monnier
2008-03-02 22:05               ` martin rudalics
2008-03-03  2:15                 ` Stefan Monnier
2008-03-03  9:09                   ` martin rudalics
2008-03-03 21:03                     ` Stefan Monnier
2008-03-07  9:33                       ` martin rudalics
2008-03-07 22:04                         ` Stefan Monnier
2008-03-08  9:55                           ` martin rudalics
2008-03-02 22:18               ` Bill Wohler
2008-03-03  9:09                 ` martin rudalics
2008-02-29  5:50   ` Bill Wohler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47C6B359.10302@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.