bug-gnu-emacs
[Top][All Lists]
Advanced

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

copy-file has bad default behavior


From: David J. Biesack
Subject: copy-file has bad default behavior
Date: Tue, 5 Dec 2000 13:10:34 -0500 (EST)

This bug report will be sent to the Free Software Foundation,
 not to your local site managers!!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

In GNU Emacs 20.7.1 (i386-*-nt4.0.1381)
 of Tue Jun 13 2000 on buffy
configured using `configure NT'

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

copy-file is inconsistent with other copy tools, such as cp(1). When
invoked from a file buffer, the destination defaults to that buffer's
file, although the prompt (nor the copy-file documentation) do not
indicate this. I.e. consider a scenario where files /a/foo and /b/bar
already exist

  C-x C-f /a/foo
  M-x copy-file RET /b/bar RET RET

When invoking copy-file, it asks for the source file; specify /b/bar.
copy-file then asks for the desitination; it prompts with the directory
name of the current buffer' file. If you press enter here, then
copy-file will default to copying /b/bar on top of and replacing
/a/foo. You get an option to confirm th

  File /a/foo already exists. Copy /b/bar to it anyway? (Yes or No)

but that's a bit late

Note that this is inconsistent with the behavior of
the GNU cp(1) program:

  cp /a/foo /b

will copy the file /a/foo into /b/foo

If the current buffer is not a file buffer, the default target appears
to be the default directory, but copy-file "tries" to replace the target
directory instead, and this fails, instead of doing the equivalent of

   cp /a/foo /b

I suggest copy-file use the source (file-name-nondirectory ) when the
target is a directory. Further, the prompt for the target should
probably be (concat default-directory "/" (file-name-nondirectory
source-file)) instead of simply a directory name.

If the behavior is not changed, the doc should at least be clearer
and say the default target file is the current buffer's file, if
the buffer has a file.

Recent input:
M-p M-p M-p M-p kp-multiply kp-multiply kp-multiply 
kp-multiply kp-multiply kp-multiply kp-multiply kp-multiply 
kp-multiply q C-x D C-x o kp-divide M-< C-n C-n C-n 
C-n C-n C-n C-n C-n M-8 M-5 M-3 M-g M-p M-p M-p M-p 
M-p M-p M-p M-p M-p M-p M-p M-p M-p M-p M-p M-p C-x 
1 C-p C-p C-p C-x k SPC M-< C-x k SPC C-h f c o p y 
- f i l SPC return down-mouse-1 mouse-movement mouse-1 
M-x C-g C-g C-g C-g lwindow down-mouse-1 mouse-movement 
mouse-1 lwindow down-mouse-1 mouse-movement mouse-1 
M-x r e p o r t - e m SPC return

Recent messages:
(setq debug-on-error nil)
Parsing error messages...
Parsing error messages...done
Mark set

Mark set

Quit [4 times]
Loading emacsbug...
Loading emacsbug...done


-- 
David J. Biesack                              SAS Institute Inc.
SAS Campus Drive Cary, NC 27513               The Power to Know
(919) 677-8000 ext 17771                      http://www.sas.com




reply via email to

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