emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Turning on savehist-mode by default


From: sbaugh
Subject: Turning on savehist-mode by default
Date: Sat, 18 Nov 2023 14:54:52 +0000
User-agent: Gnus/5.13 (Gnus v5.13)

savehist-mode is a useful mode which is turned on by many Emacs
users. [1] It matches the default behavior of programs like bash and
vim, which save command history by default.  I suggest that we should
find some way to enable savehist by default.

By default savehist creates a timer which saves the history every 5
minutes.  I suggest that by default we should just have behavior like:
(add-hook 'kill-emacs-hook #'savehist-autosave)
If the user explicitly runs (savehist-mode 1) then that would enable the
timer-based saving.

I'm not sure what other issues have prevented savehist from being turned
on by default, but I'm happy to do the work to get it into good shape.

This proposal is somewhat motivated by bug#66993, because project.el
already has some custom code which runs by default which is kind of like
savehist-mode, but which only save project--list.  It may be possible to
get rid of that code in favor of the generic savehist logic, but to do
that we'd need to turn savehist on by default in some form.

[1]: At least, savehist is turned on by every Emacs configuration
framework I've checked, in a brief search of the most popular ones:
https://git.sr.ht/~technomancy/better-defaults/tree/main/item/better-defaults.el
https://github.com/doomemacs/doomemacs/blob/986398504d09e585c7d1a8d73a6394024fe6f164/lisp/doom-editor.el#L356
https://github.com/syl20bnr/spacemacs/blob/a6a834f08af61b5a4dd80e337449f0f7026f6a0c/layers/%2Bspacemacs/spacemacs-defaults/packages.el#L401
https://github.com/bbatsov/prelude/blob/b57ff48e0985a6ef0f1ed9b279ec487c55982334/core/prelude-editor.el#L108
https://github.com/pprevos/emacs-writing-studio/blob/master/init.el#L247
https://systemcrafters.net/emacs-from-scratch/the-best-default-settings/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]