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: Re: undo refactoring
Date: Tue, 05 Jul 2016 23:22:49 +0100	[thread overview]
Message-ID: <877fczd8sm.fsf@russet.org.uk> (raw)
In-Reply-To: <jwvwpkz69r4.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 05 Jul 2016 17:50:28 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:
> IIUC, the reason for this was so as to avoid an inf-loop when malloc
> fails (for lack of memory).
>
> The particular issue was that it was OK for a command to fail because of
> malloc failure, but it was not OK for the read-eval-loop itself to fail
> before having the opportunity to run another command.

Found the documentation (near the variable rather than the method), and
yes, it's about memory allocation.


/* The first time a command records something for undo.
   it also allocates the undo-boundary object
   which will be added to the list at the end of the command.
   This ensures we can't run out of space while trying to make
   an undo-boundary.  */

That comment was from Richard, and hasn't changed since 1994; I guess
the chance of memory issues from a cons or two are less of a problem
now.

>
> My impression is that this design goal has been ignored for much too
> long, so I don't think Emacs behaves this way any more.  And instead we
> have now other ways to handle the memory-full situation (such as the
> extra memory that's pre-allocated and then released in case the memory
> is full).
>
> IOW, I'd be surprised if getting rid of this quirk would ever lead to
> a visible change in Emacs's behavior nowadays.

I've experimented with this and, at least, all the tests work. I'll try
it out in actual use, then if you are happy make the change on master.


Phil



      reply	other threads:[~2016-07-05 22:22 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                           ` undo refactoring Phillip Lord
2016-07-05 21:50                             ` Stefan Monnier
2016-07-05 22:22                               ` Phillip Lord [this message]

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=877fczd8sm.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).