[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] [patch] exit without saving the buffer
From: |
Benno Schulenberg |
Subject: |
Re: [Nano-devel] [patch] exit without saving the buffer |
Date: |
Wed, 09 Dec 2015 10:56:33 +0100 |
On Tue, Dec 8, 2015, at 21:11, Chris Allegretta wrote:
> Like the idea, and ^O^Q definitely makes sense as the proper keystrokes.
>
> I had trouble getting the patch to apply to 2.5.0 but I assume it works
> against trunk.
>
> I really think we need a do_yesno_prompt for "are you sure you want
> to lose all changes" before we bail on the editor, especially
> if the current buffer is modified.
You mean that after the user hits ^O and ^Q, you still want to
ask "Are you sure?"? Hmm... Okay.
However, for all other questions about saving a file, Yes means
"save", No means "stop" or "throw away":
"File exists, OVERWRITE ? "
"Save file under DIFFERENT NAME ? "
"File was modified since you opened it, continue saving ? "
"Failed to write backup file, continue saving? (Say N if unsure) "
"Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? "
So, to not cause the user any surprises, I think the question
should be phrased as: "Save changed buffer anyway?".
[BTW, this reminds me: in the last of the above five messages, the
question mark should be after "Save modified file", not at the end,
because "ANSWERING No..." is not part of the question.]
After having had this patch applied locally for a little while,
it starts to annoy me to have ^Q present in the WriteOut menu.
When not using --tempfile, the way to abandon a buffer is ^X N.
Only when --tempfile is given does the user need another way of
abandoning a buffer. So attached patch adds ^Q only when -t is
given.
(This version should apply to 2.5.0, with only offsets.)
Benno
--
http://www.fastmail.com - Does exactly what it says on the tin
adding-discard-buffer-2.patch
Description: Text Data