5

I'm using emacs with dired,

(require 'dired-details)
(dired-details-install)

and ido,

(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)

(setq ido-use-filename-at-point 'guess)
(setq ido-create-new-buffer 'always)

(as well as recentf as described here)

However, when I'm in dired and do copy (Shift-C) after selecting a few files, and go to the new directory where they should be pasted ... I have two non-working options: 1) either I click on a directory and go a level further into a directory I don't want. 2) I click on a file and ido complains

Marked Copy: target must be a directory:

How can I make dired paste the selected files to the new destination? Any help appreciated, thank you.

Massagran
  • 1,781
  • 1
  • 20
  • 29

2 Answers2

6

Try C-j once you are in the target directory in ido. Works for me.

Roman Bataev
  • 9,287
  • 2
  • 21
  • 15
2

The basic problem here is that while there's a read-file-name-function which ido can attach itself to, there's no read-directory-name-function, ido-mode has no explicit support for this feature of dired, and there's nothing about the read-file-name invocation I could figure out that ido-mode could hook onto.

All I can suggest is to just turn off ido by using C-f. The invocation of read-file-name by dired is so many levels deep that it wouldn't even be particularly elegant to patch:

* read-file-name("Copy <file> to: " "<dir>/" "<dir>/<file>")
  apply(read-file-name ("Copy <file> to: " "<dir>/" "<dir>/<file>"))
  dired-mark-pop-up(nil copy ("<file>") read-file-name "Copy <file> to: " "<dir>/" "<dir>/<file>")
  dired-mark-read-file-name("Copy %s to: " "<dir>/" copy nil ("<file>") "<dir>/<file>")
  dired-do-create-files(copy dired-copy-file "Copy" nil 67 nil nil)
  dired-do-copy(nil)
Nicholas Riley
  • 43,532
  • 6
  • 101
  • 124
  • Thank you Nicholas for the insight. I guess I'll just have to C-f to switch off when doing these file operations. – Massagran May 11 '11 at 21:43