Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker leak and undo history size explosion #257

Open
CyberShadow opened this issue Dec 26, 2021 · 0 comments
Open

Marker leak and undo history size explosion #257

CyberShadow opened this issue Dec 26, 2021 · 0 comments

Comments

@CyberShadow
Copy link
Contributor

Steps to reproduce:

  1. Run:

    emacs -Q \
      -l ~/.emacs.d/straight/repos/rich-minority/rich-minority.el \
      -l ~/.emacs.d/straight/repos/smart-mode-line/smart-mode-line.el \
      --eval '(setq custom-safe-themes t)' --eval '(sml/setup)'

    (adjust paths accordingly)

  2. Type something (about 20-50 characters), then undo it.

  3. Repeat step above 2-3 times.

  4. Evaluate (press M-:, paste, then RET):

    (let ((n 0))
     (mapc (lambda (el)
         (when (and (consp el) (markerp (car el)))
           (setq n (1+ n))))
       buffer-undo-list)
     n))

Normally (without SML loaded), this produces a small number. However, with SML loaded, the number is very large - in the hundreds / thousands.

SML or something it uses is creating markers in the buffer, which end up being referenced in the undo history. The undo history length grows exponentially.

I suspect that this is [partially] responsible for the number of times one can undo being very small in practice.

Possibly related Emacs bug:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52798

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant