emacs-devel
[Top][All Lists]
Advanced

[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: Mon, 6 Jul 2009 08:59:19 -0700

>     > It is somewhat dangerous _because_ it has a key binding.
> 
>     No, it was claimed that the command's behavior itself is 
>     dangerous, which means regardless of how it is called.
> 
> Practically speaking, it is only dangerous because of the key binding.
> If people had to run it with M-x, they would not type it by habit,
> so it would not cause a problem.

What you say is true of `kill-buffer' also. And `kill-buffer' presents exactly
the same problem reported: it does not warn you that you will lose data in a
`*shell*' buffer you kill.

Whether that problem is important is another question. But that is the problem
the OP reported. `find-alternate-file and `kill-buffer' are in exactly the same
boat. `find-alternate-file' is in this boat simply because it calls
`kill-buffer'. `kill-buffer' is what is problematic.

The solution is to make `kill-buffer' DTRT, either by improving its test (which
is currently just for a modified file buffer) or by letting users customize that
test.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]