unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: 'Juri Linkov' <juri@jurta.org>,
	deniz.a.m.dogan@gmail.com, rms@gnu.org, emacs-devel@gnu.org
Subject: RE: delete-file default to buffer-file-name if non-nil
Date: Mon, 17 May 2010 07:56:59 -0700	[thread overview]
Message-ID: <285B9320BDDE48BABD15E9BF02599CB0@us.oracle.com> (raw)
In-Reply-To: <jwvy6fiwsdk.fsf-monnier+emacs@gnu.org>

> > A better approach is to let the user decide the behavior.
> > I have this option (FWIW):
> >
> > | When the default value argument to functions such as
> > | `completing-read', `read-file-name', `read-from-minibuffer', and
> > | `read-string' is non-nil and the initial-input argument is nil or
> > | "", the default value can be added to the prompt as a hint or
> > | inserted into the minibuffer as the initial input.
> 
> IIUC this is not using the initial-contents argument (more to the
> point, it's only active if this arg is nil, i.e. if the 
> caller properly treats it a deprecated). So this is perfectly
> compatible with initial-contents's obsolescence.

Yes, that option is only about using the default value.

But it was the general idea that it can sometimes be useful to put a value into
the minibuffer that I was trying to get across. I believe that feature can be
useful for the user (hence the default-value option) and in some cases it can be
useful for particular commands (using INIT-VALUE).

The latter cases are admittedly exceptions - I do not propose using INIT-VALUE
often. `delete-file' is a case in point. IMO, if the default file name is put in
the minibuffer as init value it is less likely that a user will inadvertently
hit RET and end up accidentally deleting the file.

You might disagree, but I think that putting the name in the minibuffer draws
more attention to it than just putting it in the prompt - particularly if
INIT-VALUE is seldom used. It is a good compromise between doing nothing
(default in prompt only) and requiring confirmation each time. It gives a little
more protection against accident than just mentioning the file in the prompt,
but it adds no confirmation delay/annoyance.

AFAIK, `delete-file' is not bound to any key by default. Anyone calling it
interactively is doing so either via M-x, via a user-defined key, or via some
other command that calls it interactively. I expect that requiring confirmation
would defeat the aim of quick interaction. 

Remember too: `delete-file' has been around since Day One with exactly the same
user interaction. That's a long time for something "dangerous" to be tolerated.
How many people actually use it interactively? Of those, how many have reported
problems due to the danger in question? Versus: how many of those interactive
users would be annoyed by needing to confirm?

I mentioned two suggestions: (1) put file name in minibuffer or (2) require
confirmation. I didn't see any other suggestions mentioned. I still think #1 is
better overall than #2.




  reply	other threads:[~2010-05-17 14:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-15 18:05 delete-file default to buffer-file-name if non-nil Deniz Dogan
2010-05-15 18:30 ` Davis Herring
2010-05-15 22:10   ` Deniz Dogan
2010-05-16 20:04   ` Richard Stallman
2010-05-16 20:20     ` Drew Adams
2010-05-16 23:09       ` Juri Linkov
2010-05-17  0:28         ` Drew Adams
2010-05-17 13:51           ` Stefan Monnier
2010-05-17 14:56             ` Drew Adams [this message]
2010-05-17 16:15               ` Deniz Dogan
2010-05-17 23:09               ` Juri Linkov
2010-05-18 22:38                 ` Juri Linkov
2010-05-17 14:40       ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=285B9320BDDE48BABD15E9BF02599CB0@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=deniz.a.m.dogan@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).