Subject: 23.0.60; ido-write-file makes it easy to overwrite files unintentionally

From: "andreas.amann" <[email-masked]>
Date: Fri, 24 Oct 2008 11:53:00 +0100

I am often using the C-x C-w shortcut to save a buffer into a
different directory, usually without changing it's name. 

The standard write-file works well for this, since after selecting the
appropriate directory, I simply hit return, and the file gets saved
where I want it, without a change in the name by default. 

However, since I switched to ido-mode and ido-write-file I found that
after navigating to a directory, which does not contain any
subdirectories, the first filename in that directory gets selected as
the filename, into which to write the contents of the active
buffer. This has several times already caused me to overwrite a file
with the current buffer by accident, since after selecting the
appropriate directory, I was not noticing the selection and wrongly
assumed that emacs would simply write the file into this directory
with the old filename. After hitting return however the active buffer
would be written into this first file of the directory.

I know I can simply work around this by binding C-x C-w to write-file,
but in my opinion, ido-write-file should be changed in a way which
makes it more difficult to overwrite a file. I would expect that C-x
C-w is used for more often to create a new file, than to overwrite an
existing one. Therefore in my opinion the current behaviour of
ido-write-file to select the first file in the directory only serves
a minority of use-cases.

In GNU Emacs 23.0.60.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2008-10-20 on lnx0015f2465ec6
Windowing system distributor `The X.Org Foundation', version 11.0.10300000
configured using `configure  '--prefix=/home/aamann/local/emacs-cvs' 'LDFLAGS=-L/home/aamann/local/lib64' 'CPPFLAGS=-I/home/aamann/local/include''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_IE.utf8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x i d o - m o d <tab> <return> C-x C-w C-g M-x w 
r i t e - f <tab> <return> C-g M-x i d o - w r i <tab> 
<return> C-g C-x C-w C-g C-h C-b C-h b C-x o C-s w 
r i t e <up> <up> <down> <down> <left> <left> <left> 
C-x o M-x w e m <backspace> <backspace> <backspace> 
e m a c s <tab> b <tab> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
b u g <tab> <tab> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> r e p <tab> o r <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Ido mode enabled
Quit [4 times]
Type C-x 1 to delete the help window, C-M-v to scroll help.
Mark saved where search started
Making completion list... [2 times]