Disallow the *scratch* buffer from being killed
(use-package unkillable-scratch :ensure t :pin melpa-stable :config (unkillable-scratch t))
Or manually, after downloading into your
(require 'unkillable-scratch) (unkillable-scratch t)
unkillable-scratch-behavior defines the action taken when a kill
is attempted on a buffer matching one or more of the regexp's in the list
unkillable-buffers. This list will only match one buffer by default, the
This package treats the
*scratch* buffer specially; in the event of a call to
kill-buffer the buffer contents will be replaced with
initial-scratch-message. To disable this behavior set
The following values of
unkillable-scratch-behavior are supported
||bury the buffer instead of killing it (default)|
||disallow the attempted kill from occurring|
||kill the buffer -- same as disabling the minor mode|
persistent-scratch is definitely worth a look.
The inspiration to make the
unkillable-buffers list came from
Donald Curtis (milkypostman)
If I were the type of person to proliferate breaking-changes, I would
unkillable-scratch minor-mode to
unkillable-scratch-mode for conventions' sake.
Making this change would necessitate re-publishing the package to MELPA and only consume the time of the MELPA maintainers and every user of this package without making any functional changes, so for now just note that said function is enabling a global minor-mode.
GPL 2 (or higher) © Free Software Foundation, Inc.