在Emacs dired,如何查找/访问多个文件? [英] In Emacs dired, how to find/visit multiple files?

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

问题描述

如果我有多个文件被标记,我如何在Emacs中找到/访问所有这些标记的文件,然后在每个文件上运行 dired-find-file p>

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

解决方案

如果你将这个添加到你的.emacs,你可以通过键盘F打开文件。

 (eval-after-loaddired
'(progn
(define-key dired-mode-mapF'my-dired-find-file)
defun my-dired-find-file(& optional arg)
打开每个标记的文件,或点下的文件,或者当前缀arg时,下一个N个文件
(interactive) P)
(let *((fn-list(dired-get-marked-files nil arg)))
(mapc'find-file fn-list))))

显然,如果需要,您可以覆盖内置的f。


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?

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

解决方案

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

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

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆