emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: delete-file default to buffer-file-name if non-nil


From: Deniz Dogan
Subject: Re: delete-file default to buffer-file-name if non-nil
Date: Sun, 16 May 2010 00:10:23 +0200

2010/5/15 Davis Herring <address@hidden>:
>> Could we change the behavior of delete-file so that it defaults to
>> buffer-file-name if non-nil, otherwise the current directory, if
>> called interactively?
>
> Doesn't it already do that?  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.
>
> Davis
>

It seems you are right. The prompt confused me, as it defaults to the
directory which the file is in.

So new suggestion... :) Either the prompt displays the file name for
the current buffer OR the documentation for delete-file is updated to
describe this (in my opinion) non-intuitive behavior. The info node
which briefly describes delete-file says the following:

   `M-x delete-file' deletes the specified file, like the `rm' command
in the shell.  If you are deleting many files in one directory, it may
be more convenient to use Dired rather than `delete-file'.  *Note
Dired::.

What do you say?

-- 
Deniz Dogan



reply via email to

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