[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: delete-file default to buffer-file-name if non-nil
From: |
Juri Linkov |
Subject: |
Re: delete-file default to buffer-file-name if non-nil |
Date: |
Mon, 17 May 2010 02:09:31 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) |
>> M-x delete-file RET does attempt to delete the current buffer's
>> file or its directory if it has no file. Personally, I find this
>> default sort of dangerous, although at least C-x C-w often
>> fixes it.
>>
>> It seems dangerous to me too.
>
> But it seems the most appropriate default value, in terms of what one might
> want
> to delete. Don't you think so?
I think `read-file-name' should not use the default value when it is
not visible either in the prompt (displayed with the standard text
" (default filename): ") or in the minibuffer.
> If it is also dangerous, then some reasonable way should be found to deal
> with the danger - as opposed to simply changing the default value.
>
> Two (alternative) solutions that come to mind:
>
> 1. Insert the default value in the minibuffer. This assumes that the
> greatest danger is hitting RET without seeing what the file to be
> deleted is.
The argument INITIAL-CONTENTS is obsolete and should not be used.
It's possible to insert the default value to the minibuffer with `M-n'.
> 2. Require confirmation if RET is hit with no file name in the minibuffer.
Deleting from Dired requires confirmation, so perhaps `delete-file'
should require confirmation too.
--
Juri Linkov
http://www.jurta.org/emacs/
- delete-file default to buffer-file-name if non-nil, Deniz Dogan, 2010/05/15
- Re: delete-file default to buffer-file-name if non-nil, Davis Herring, 2010/05/15
- Re: delete-file default to buffer-file-name if non-nil, Deniz Dogan, 2010/05/15
- Re: delete-file default to buffer-file-name if non-nil, Richard Stallman, 2010/05/16
- RE: delete-file default to buffer-file-name if non-nil, Drew Adams, 2010/05/16
- Re: delete-file default to buffer-file-name if non-nil,
Juri Linkov <=
- RE: delete-file default to buffer-file-name if non-nil, Drew Adams, 2010/05/16
- Re: delete-file default to buffer-file-name if non-nil, Stefan Monnier, 2010/05/17
- RE: delete-file default to buffer-file-name if non-nil, Drew Adams, 2010/05/17
- Re: delete-file default to buffer-file-name if non-nil, Deniz Dogan, 2010/05/17
- Re: delete-file default to buffer-file-name if non-nil, Juri Linkov, 2010/05/17
- Re: delete-file default to buffer-file-name if non-nil, Juri Linkov, 2010/05/18
- Re: delete-file default to buffer-file-name if non-nil, Richard Stallman, 2010/05/17