Function: savehist-install

savehist-install is a byte-compiled function defined in savehist.el.gz.

Signature

(savehist-install)

Documentation

Hook Savehist into Emacs.

Normally invoked by calling savehist-mode(var)/savehist-mode(fun) to set the minor mode. Installs savehist-autosave in kill-emacs-hook and on a timer. To undo this, call savehist-uninstall.

Source Code

;; Defined in /usr/src/emacs/lisp/savehist.el.gz
(defun savehist-install ()
  "Hook Savehist into Emacs.
Normally invoked by calling `savehist-mode' to set the minor mode.
Installs `savehist-autosave' in `kill-emacs-hook' and on a timer.
To undo this, call `savehist-uninstall'."
  (add-hook 'minibuffer-setup-hook #'savehist-minibuffer-hook)
  (add-hook 'kill-emacs-hook #'savehist-autosave)
  ;; Install an invocation of savehist-autosave on a timer.  This
  ;; should not cause noticeable delays for users -- savehist-autosave
  ;; executes in under 5 ms on my system.
  (when (and savehist-autosave-interval
	     (null savehist-timer))
    (setq savehist-timer
	  (run-with-timer savehist-autosave-interval
			  savehist-autosave-interval #'savehist-autosave))))