evil-quit silently closes window with modified buffer
- Dominant language
- Emacs Lisp
- Stars
- 3.9k
- Forks
- 307
- PR merge metrics
- No merged PRs in 30d
Description
# Issue type
- Enhancement request
# Environment
Emacs version: GNU Emacs 25.2.1 (x86_64-w64-mingw32) of 2017-04-24
Operating System: Windows 10
Evil version: 1.2.12
Evil installation type: git clone from github
Graphical/Terminal: Graphical
Tested in a [clean environment](https://github.com/emacs-evil/evil/blob/master/CONTRIBUTING.md#bug-reports): Yes
# Reproduction steps
- Start Emacs
- Visit an existing file in a new window
- Modify the buffer
- In normal state type `:quit` or press ` q`
# Expected behavior
Evil does not close the window, but complain about unsaved changes in the buffer, like Vim does.
# Actual behavior
The window is closed. The buffer still exists (with the modification made by the user).
# Further notes
When quitting an unmodified buffer in Vim, the buffer is still in the bufferlist and can be accessed by typing `:buffer `. Vim does not kill the buffer, but nevertheless complains about modified content. Evil does also not kill the buffer, but neither does it complain about modified content. This is the default behavior in Emacs (which is the reason why I classified this issue as an enhancement request).
Therefore I suggest a customizable evil parameter, stating if `evil-quit` shall complains about a modified buffer or not. Its default value would be the one that means "complain about buffer modification".
Contributor guide
Research direction
Start by tracing the evil-quit handling used by :quit and C-w q, then compare its behavior for modified and unmodified buffers. Confirm how the existing commands preserve the buffer, and define done as warning about unsaved changes before closing the window, with the requested customizable behavior and default established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs, emacs-lisp
- Domain
- desktop, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100