all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: Emerick Rogul <emerick@gmail.com>, 1501@debbugs.gnu.org
Subject: bug#1501: Emacs 22 loses undo buffer
Date: Tue, 20 Aug 2019 20:36:13 +0200	[thread overview]
Message-ID: <CADwFkm=b6_hZdS=cTt4=73YkOPapH-TJOvfUu4v=eBCsXJMGQw@mail.gmail.com> (raw)
In-Reply-To: <a8b2c60d0812050851n69acd851pd87ddb375674d370@mail.gmail.com>

Chong Yidong <cyd@stupidchicken.com> writes:

> "Emerick Rogul" <emerick@gmail.com> writes:
>
>> That's clearly not the issue at all, since the header file is only 8k
>> in total size.  What's more, I get the message after hitting the undo
>> key sequence a couple of times.  Also, this works perfectly fine in
>> Emacs 21.2, as I mentioned in my initial report.
>
> In the key sequence you reported:
>
> ... C-k C-k C-k C-k C-k C-k C-k C-k C-k
> C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k C-k
> [snip]
> C-k C-k C-k C-k C-k C-k C-/ C-/ C-/ C-/ C-/ C-/ C-/
> C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/ C-/
> C-/ ESC x r e p o r t - e m a <tab> <return>
>
> it appears that you hit C-/ 22 times.  If Emacs kept 22 undo records,
> and each undo record takes about 1 kilobyte, that is enough to hit the
> default undo limit.  It might be that each undo record takes more space
> in Emacs 23 than in Emacs 21, which is why you don't see the problem in
> Emacs 21 (there are several reasons why this could happen, which could
> be investigated).
>
> I do observe the same behavior that you reported, using the key sequence
> you supplied; furthermore, if I increase undo-limit to a larger number,
> I find that Emacs can undo all the way back to the buffer's original
> state.

Chong Yidong <cyd@stupidchicken.com> writes:

> I've expanded the undo limits by a factor of four.  A more sophisticated
> fix, if one exists, will have to wait till after the release.

The undo limits were recently again doubled on master in commit
9466372 in relation to Bug#31104.  The latter change will be included
in the next major version of Emacs (version 27.1).

If you're still seeing this problem on a recent version of Emacs, a
workaround is to increase the values of the variables undo-limit,
undo-outer-limit and undo-strong-limit.  You could add something like
the following to your init file:

(setq undo-limit        (* 2 undo-limit))
(setq undo-outer-limit  (* 2 undo-outer-limit))
(setq undo-strong-limit (* 2 undo-strong-limit))

Of course, you could use a bigger number than 2 should that be necessary.

Given the discussion in Bug#31104, I'm not sure there's more to do
here.  But the discussion here also suggests that there have been an
increase in the memory usage of each undo record, especially when
using font-lock-mode.  I'm not sure that is a serious problem, since
memory is only getting cheaper, but it might be worth investigating.
On the other hand, we could just decide that this is not worth the
effort and close this as wontfix.

Thanks,
Stefan Kangas





  reply	other threads:[~2019-08-20 18:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-05 16:51 bug#1501: Emacs 22 loses undo buffer Emerick Rogul
2019-08-20 18:36 ` Stefan Kangas [this message]
2019-08-20 18:45   ` Noam Postavsky
2019-08-21 14:46     ` Stefan Kangas
2019-08-22  1:19       ` Noam Postavsky
2021-10-20  1:01         ` Stefan Kangas
2021-10-20 12:05           ` Eli Zaretskii
2021-10-21 20:46             ` Stefan Kangas
  -- strict thread matches above, loose matches on Subject: below --
2008-12-06  4:01 Chong Yidong
2008-12-06 21:02 Emerick Rogul
2008-12-07  1:31 ` Chong Yidong
2008-12-07  2:03   ` Emerick Rogul
2008-12-07  5:36     ` Chong Yidong
2008-12-07  5:48     ` Chong Yidong
2008-12-07 12:36       ` Emerick Rogul
2009-01-27 20:58 Chong Yidong
2009-04-24 22:14 Suresh Kannan

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='CADwFkm=b6_hZdS=cTt4=73YkOPapH-TJOvfUu4v=eBCsXJMGQw@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=1501@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=emerick@gmail.com \
    /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.