Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

copy paste various files using dired on emacs while using ido.el

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.

like image 512
Massagran Avatar asked Apr 15 '11 18:04

Massagran


People also ask

How do I copy a dired file?

In order to copy a file with Dired, use your arrow keys (or n [down one line] and p [up one line]) to drop your cursor over a certain file. Type the C key and you will be prompted, in the minibuffer, to rename the file.

How to make a copy of a file in emacs?

Use C (command dired-do-copy ) to copy the marked files.

What is Emacs dired?

Dired makes an Emacs buffer containing a listing of a directory, and optionally some of its subdirectories as well. You can use the normal Emacs commands to move around in this buffer, and special Dired commands to operate on the listed files. Dired works with both local and remote directories.


2 Answers

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

like image 102
Roman Bataev Avatar answered Sep 30 '22 12:09

Roman Bataev


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)
like image 42
Nicholas Riley Avatar answered Sep 30 '22 12:09

Nicholas Riley