git clone 'git://github.com/Fanael/persistent-scratch.git'
persistent-scratch is an Emacs package that preserves the state of scratch
buffers accross Emacs sessions by saving the state to and restoring it from a
The package is available in MELPA and MELPA Stable.
If you have MELPA or MELPA Stable in
M-x package-install RET persistent-scratch RET
If you don't, open
persistent-scratch.el in Emacs and call
Other installation methods are unsupported.
To save the current state of scratch buffers to file indicated by
To restore scratch buffers from
To save the state to an arbitrary file:
To restore the state from an arbitrary file:
To toggle periodic autosave:
To create a new backup file (only when backup is enabled, see
persistent-scratch-backup-directory), so that the next
persistent-scratch-save won't overwrite the existing backup:
To customize the save file path, what state to save, the autosave period, what buffers are considered scratch buffers and whether to backup old saved states:
M-x customize-group RET persistent-scratch RET
Variables can be customized either via
customize or by setting them via
To both enable autosave and restore the last saved state, if any, on Emacs
to the init file. This will not error when the save file doesn't exist.
To just enable autosave, enable
persistent-scratch-autosave-mode like any
other minor mode:
To just restore the last saved file, use
persistent-scratch-restore. Bear in
mind it may signal an error if there's no save file, so it's a good idea to call