本文介绍了在 Emacs dired 中,如何查找/访问多个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我标记了多个文件,除了在每个文件上运行 dired-find-file 之外,我如何在 emacs 中查找/访问所有这些标记的文件?

If I have multiple files marked, how do I find/visit all those marked files in emacs, beside running dired-find-file on each of them?

是否有内置命令,或者我是否需要一些额外的 lisp 代码?

Is there a build-in command, or do I need some extra lisp code?

推荐答案

如果您将此添加到您的 .emacs,您将能够通过键绑定F"打开文件.

If you add this to your .emacs, you'll be able to open the files via the keybinding 'F'.

(eval-after-load "dired"
  '(progn
     (define-key dired-mode-map "F" 'my-dired-find-file)
     (defun my-dired-find-file (&optional arg)
       "Open each of the marked files, or the file under the point, or when prefix arg, the next N files "
       (interactive "P")
       (let* ((fn-list (dired-get-marked-files nil arg)))
         (mapc 'find-file fn-list)))))

显然,您可以根据需要覆盖内置的f".

Obviously you can just override the built-in 'f' if you want.

这篇关于在 Emacs dired 中,如何查找/访问多个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 00:59