unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: phillip.lord@russet.org.uk (Phillip Lord)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: undo refactoring
Date: Tue, 05 Jul 2016 09:46:46 +0100	[thread overview]
Message-ID: <8760skcw09.fsf_-_@russet.org.uk> (raw)
In-Reply-To: <jwv60sl85nl.fsf-monnier+Inbox@gnu.org> (Stefan Monnier's message of "Mon, 04 Jul 2016 17:32:45 -0400")



I thought to move this to emacs-devel rather than #23781 since it's not
directly relevant.


I'll think about the FIXME, that I've just added to undo.c, and see if I
can update that on master. But also, while reading the code again, I've
realised that I don't understand the reason for pre-allocating the
boundary, since when it actually used we do this:


      /* One way or another, cons nil onto the front of the undo list.  */
      if (!NILP (pending_boundary))
	{
	  /* If we have preallocated the cons cell to use here,
	     use that one.  */
	  XSETCDR (pending_boundary, BVAR (current_buffer, undo_list));
	  bset_undo_list (current_buffer, pending_boundary);
	  pending_boundary = Qnil;
	}
      else
	bset_undo_list (current_buffer,
			Fcons (Qnil, BVAR (current_buffer, undo_list)));


Why not just do

	bset_undo_list (current_buffer,
			Fcons (Qnil, BVAR (current_buffer, undo_list)));

and remove all references to pending_boundary (and therefore
`prepare_record` which is now rather badly named)? Or am I missing
something

Phil



       reply	other threads:[~2016-07-05  8:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2mvm3fz14.fsf@metalevel.at>
     [not found] ` <83h9cavdgj.fsf@gnu.org>
     [not found]   ` <87poqyy2tc.fsf@metalevel.at>
     [not found]     ` <87vb0qqrkz.fsf@russet.org.uk>
     [not found]       ` <87h9c9zx75.fsf@metalevel.at>
     [not found]         ` <834m89vmyv.fsf@gnu.org>
     [not found]           ` <878txlsbdb.fsf@russet.org.uk>
     [not found]             ` <87furtccdv.fsf@metalevel.at>
     [not found]               ` <877fd5q9te.fsf@russet.org.uk>
     [not found]                 ` <83bn2gtruk.fsf@gnu.org>
     [not found]                   ` <87k2h37pvb.fsf@russet.org.uk>
     [not found]                     ` <jwv37nqa0dc.fsf-monnier+bug#23871@gnu.org>
     [not found]                       ` <87vb0lta67.fsf@russet.org.uk>
     [not found]                         ` <jwv60sl85nl.fsf-monnier+Inbox@gnu.org>
2016-07-05  8:46                           ` Phillip Lord [this message]
2016-07-05 21:50                             ` undo refactoring Stefan Monnier
2016-07-05 22:22                               ` Phillip Lord

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=8760skcw09.fsf_-_@russet.org.uk \
    --to=phillip.lord@russet.org.uk \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).