Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/EricCrosson/unkillable-scratch
Disallow the *scratch* buffer from being killed
https://github.com/EricCrosson/unkillable-scratch
buffer emacs gnu scratch unkillable
Last synced: 3 months ago
JSON representation
Disallow the *scratch* buffer from being killed
- Host: GitHub
- URL: https://github.com/EricCrosson/unkillable-scratch
- Owner: EricCrosson
- License: gpl-2.0
- Created: 2015-03-12T02:35:38.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-10-15T13:23:51.000Z (over 2 years ago)
- Last Synced: 2024-08-05T06:04:03.532Z (6 months ago)
- Topics: buffer, emacs, gnu, scratch, unkillable
- Language: Emacs Lisp
- Size: 51.8 KB
- Stars: 13
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# unkillable-scratch [![Build Status](https://travis-ci.org/EricCrosson/unkillable-scratch.svg?branch=master)](https://travis-ci.org/EricCrosson/unkillable-scratch) [![MELPA Stable](https://stable.melpa.org/packages/unkillable-scratch-badge.svg)](https://stable.melpa.org/#/unkillable-scratch) [![MELPA](http://melpa.org/packages/unkillable-scratch-badge.svg)](http://melpa.org/#/unkillable-scratch)
> Disallow the \*scratch\* buffer from being killed
## Install
From [MELPA](https://melpa.org/)
``` {.sourceCode .lisp}
(use-package unkillable-scratch
:ensure t
:pin melpa-stable
:config (unkillable-scratch t))
```Or manually, after downloading into your `load-path`
``` {.sourceCode .lisp}
(require 'unkillable-scratch)
(unkillable-scratch t)
```## Use
The variable `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
`*scratch*` buffer.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
`unkillable-scratch-do-not-reset-scratch-buffer` to `t`.The following values of `unkillable-scratch-behavior` are supported
| Setting | Meaning |
|--------------:|-----------------------------------------------------|
| `'bury` | bury the buffer instead of killing it (default) |
| `'do-nothing` | disallow the attempted kill from occurring |
| `'kill` | kill the buffer -- same as disabling the minor mode |## Related
[persistent-scratch](https://github.com/Fanael/persistent-scratch) is
definitely worth a look.## Acknowledgments
The inspiration to make the `unkillable-buffers` list came from
[Donald Curtis (milkypostman)](http://emacswiki.org/emacs/RecreateScratchBuffer)## Contributors
- [@tarsius](https://github.com/tarsius) for advice on best-practices
- [@djl](https://github.com/djl) for the feature to persist `*scratch*`-buffer contents## Regrets
If I were the type of person to proliferate breaking-changes, I would
rename the `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.## License
GPL 2 (or higher) © [Free Software Foundation, Inc](http://www.fsf.org/about).