Emacs Dired: weird behavior of `dired

The behavior I have is odd at best, but the situation is simple: given a folder test , I want to make a copy of it in another folder.

In practice:

  • Open Emacs, Mx dired in any folder.
  • +test to create a folder test .
  • +target to create a folder target .
  • Move on test then Ctarget/ to copy it in target .
  • So far so good, the empty test folder is copied as expected. Assuming there is some change in this folder, we want to copy it again to the same place:

  • Move on test then Ctarget/ to copy it in target .
  • Dired asks for confirmation to overwrite it, and if yes copies it again.
  • Now the weird behavior. With (setq dired-dwim-target t) :

  • Open a second window Cx 3
  • Move to target in this window, as to have target on the right window, but the initial folder on the left window.
  • In the left window, move on test and C to copy it again, DWIM will suggest directly target/ , so all that is needed is Enter.
  • Note that there is no question to overwrite it or not. Visiting target now shows the test folder, but inside it a second copy of test !

    Even weirder:

  • Create an empty file in the original folder (Cx C-fbla, then Cx Cs to save it, and Cx k to kill it).
  • Select in the left window both test and bla with m.
  • C to copy them, DWIM will suggest directly target/ , so all that is needed is Enter.
  • Now it asks for confirmation and copies test together with bla in target as expected!

    What am I missing?

    (of course, this example mostly uses empty folders, but that's really just for the demonstration.)

    链接地址: http://www.djcxy.com/p/62188.html

    上一篇: 我们如何比较不同操作系统的ASLR?

    下一篇: Emacs Dired:`dired的奇怪行为