[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: C-x C-v considered harmful
From: |
Drew Adams |
Subject: |
RE: C-x C-v considered harmful |
Date: |
Sun, 5 Jul 2009 07:56:10 -0700 |
> But I am really curious to know why Richard changed
> this in rev 1.192 to the current (and (buffer-modified-p)
> (buffer-file-name)) behavior. Richard, do you remember?
>
> I don't remember, but I would guess it is becuase most
> non-file-visiting buffers don't contain precious information.
> I probably did not think about the cases where they do.
To be clear about my own position: I said I think the right test for
`kill-buffer' to use is `(or buffer-read-only (buffer-modified-p))', but that
is only if people decide that loss of data in non-file buffers is indeed a
problem that needs solving.
Personally, I don't have a problem with the current situation, but if we do
decide to make a change to prevent data loss in such buffers, then I think that
is the best such change.
Another, alternative possibility would be to test whether (besides a modified
file buffer) the buffer belongs to some specified set. The set of buffers to
warn about could be defined using a list of buffer names or regexps that match
buffer names.
I mention this because I think it does make sense that most modified non-file
buffers _not_ warn you when they are killed - perhaps even most that are not
read-only. If `kill-buffer' were to warn each time you kill such a buffer it
might prove annoying.
However, the `buffer-read-only' test would go a long way toward eliminating such
annoyance. Many non-file buffers that would be `buffer-modified-p' are in fact
read-only. That includes buffers such as `*grep*', `*Buffer List*', and Dired.
The "data" in such buffers is not normally something that we worry about losing
accidentally.
I guess the question is whether most other non-file buffers are more like
`*shell*', where a warning might be appropriate, or are more like `*grep*',
where a warning is probably inappropriate. If `*shell*' is rather the exception,
then perhaps it would be best to treat it as an exception, using, say, an option
`kill-buffer-warn-regexps', with a value of, say, `(,(regexp-quote "*shell*"))'.
IOW, do something similar to `same-window-regexps' and
`same-window-buffer-names'.
- RE: C-x C-v considered harmful, (continued)
- RE: C-x C-v considered harmful, Bob Rogers, 2009/07/02
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/02
- RE: C-x C-v considered harmful, Bob Rogers, 2009/07/03
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/03
- RE: C-x C-v considered harmful, Bob Rogers, 2009/07/04
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/05
- RE: C-x C-v considered harmful, Bob Rogers, 2009/07/05
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/05
- Re: C-x C-v considered harmful, Johan Bockgård, 2009/07/07
- Re: C-x C-v considered harmful, Richard Stallman, 2009/07/05
- RE: C-x C-v considered harmful,
Drew Adams <=
- Re: C-x C-v considered harmful, Richard Stallman, 2009/07/04
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/05
- Re: C-x C-v considered harmful, Richard Stallman, 2009/07/06
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/06
- Re: C-x C-v considered harmful, Richard Stallman, 2009/07/07
- Re: C-x C-v considered harmful, Robert J. Chassell, 2009/07/06
- Re: C-x C-v considered harmful, Juri Linkov, 2009/07/06
- RE: C-x C-v considered harmful, Drew Adams, 2009/07/06
- Re: C-x C-v considered harmful, Juri Linkov, 2009/07/07
- Re: C-x C-v considered harmful, Juri Linkov, 2009/07/08