在使用 ido.el 的同时,在 emacs 上使用 dired 复制粘贴各种文件

发布于 11-01 19:44 字数 650 浏览 14 评论 0原文

我将 emacs 与 dired

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

和 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)

一起使用(以及最近描述的 此处

但是,当我处于 Dired 状态并在选择几个文件后进行复制(Shift-C)时, 并转到应粘贴它们的新目录...我有两个不起作用的选项: 1)要么我单击一个目录,然后进一步进入我不想要的目录。 2)我点击一个文件并 艾多抱怨

标记副本:目标必须是 目录:

如何将选定的文件直接粘贴到新的目的地? 任何帮助表示感谢,谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

禾厶谷欠2024-11-08 19:44:34

进入 ido 的目标目录后尝试 Cj。对我有用。

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

屌丝范2024-11-08 19:44:34

这里的基本问题是,虽然有一个 ido 可以将其自身附加到的 read-file-name-function ,但没有 read-directory-name-function< /code>,ido-mode 没有明确支持 dired 的此功能,并且没有关于 read-file-name 调用的信息可以弄清楚 ido-mode 可以挂接。

我所能建议的就是使用 Cf 关闭 ido。 dired 对 read-file-name 的调用深度如此之多,以至于修补起来也不是特别优雅:

* 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)

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)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文