temporary-persistent - easy way to switch temp buffers and keep them persistent.
When you open a temp buffer you don't need to save it manually, it'll be saved automatically any time you kill this buffer or Emacs.
See also: persistent-scratch
Add MELPA (if not yet) to your
package-archives
list.
Then you can install temporary-persistent with the following command:
M-x package-install [RET] temporary-persistent [RET]
The only usefull function you should bind to customize this package is
temporary-persistent-switch-buffer
.
As for me, I'm rarely close my Emacs, so I dislike to waste handy
C-x C-c keys. But you can use any bindings you like.
(global-set-key (kbd "C-x C-c") 'temporary-persistent-switch-buffer)
Then, when you press C-x C-c, *temp*
buffer will be created.
When you press M-1 C-x C-c, *temp-1*
buffer will be created and so on.
There are 3 cases Emacs save your temp buffer:
kill-buffer
kill-emacs
- Save buffer manually via ordinary
save-buffer
function.
You can enable some submodes for new temp buffers by default:
(setq temporary-persistent-default-submodes (list 'linum-mode
'auto-fill-mode
'auto-complete-mode))
Change folder to keep temporary buffers data if you like:
(setq temporary-persistent-store-folder "~/temp")
You can also change template for temporary buffer names:
(setq temporary-persistent-buffer-name-template "temp")
Copyright © 2016-2023 Kostafey kostafey@gmail.com
Distributed under the General Public License 3.0+