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

[spacemacs-defaults] Tweak savehist configuration #16762

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

fnussbaum
Copy link
Collaborator

@fnussbaum fnussbaum commented Dec 27, 2024

  1. Use an idle timer instead of a strict periodic autosave interval. Saving large histories can cause noticable delays, and the default history-length set by Spacemacs is relatively large (1000).

  2. Save kill-ring without text properties, as they are known to cause significant performance problems and huge history files in some cases, and persisting them in the kill-ring usually brings little benefit. This should fix Spacemacs freezes from time to time. When this happens it eats up almost all memory and CPU. #1300, fix Spacemacs gets stuck for a few seconds and hogs CPU(100% usage) from time to time #1369 and fix emacs eats cpu 100% frequently #9409 again.

  3. Add kmacro-ring and log-edit-comment-ring as additional variables. They are useful and usually not very large. BTW, search-ring, regexp-search-ring and extended-command-history are redundant here as long as long as savehist-save-minibuffer-history is non-nil (the default). I decided to leave them there for now to avoid any breaking changes for users that customized that option, though I guess it could be okay to change this.

1. Use an idle timer instead of a strict periodic autosave interval. Saving
large histories can cause noticable delays, and the default `history-length` set
by Spacemacs is relatively large (1000).

2. Save `kill-ring` without text properties, as they are known to cause
significant performance problems and huge history files in some cases, and
persisting them in the kill-ring usually brings little benefit.
This should fix syl20bnr#1300, syl20bnr#1369 and syl20bnr#9409 again.

3. Add `kmacro-ring` and `log-edit-comment-ring` as additional variables. They
are useful and usually not very large. BTW, `search-ring`, `regexp-search-ring`
and `extended-command-history` are redundant here as long as long as
`savehist-save-minibuffer-history` is non-nil (the default). I decided to leave
them there for now to avoid any breaking changes for users that customized that
option, though I guess it could be okay to change this.
@fnussbaum
Copy link
Collaborator Author

fnussbaum commented Dec 30, 2024

  1. Use an idle timer instead of a strict periodic autosave interval. Saving large histories can cause noticable delays, and the default history-length set by Spacemacs is relatively large (1000).

I think an idle timer is a reasonable choice here, note that savehist-autosave is also called in the kill-emacs-hook. So the only case where this change would cause more savehist data to be lost than before is if users work for a long time without ever pausing for a minute, and then Emacs crashes in a way that does not trigger kill-emacs-hook (which should be very rare). But let me know if you object to this.

Copy link
Collaborator

@smile13241324 smile13241324 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very good

@smile13241324 smile13241324 merged commit 5fb42ce into syl20bnr:develop Dec 31, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants