37

複数のファイルにマークを付けている場合、それぞれで実行する以外に、emacsでマークされたすべてのファイルを見つけてアクセスするにはどうすればよいdired-find-fileですか?

組み込みコマンドはありますか、それとも追加のlispコードが必要ですか?

4

3 に答える 3

34

Emacs 23.2 以降では、このdired-x.elモジュールが利用可能であり、必要なことを正確に実行するコマンドにアクセスできます。それをロードした後((load "dired-x")通常はそのまま)、関数を呼び出すことができますdired-do-find-marked-files。組み込みのドキュメントは次のとおりです。

(dired-do-find-marked-files &optional NOSELECT)

Find all marked files displaying all of them simultaneously.
With optional NOSELECT just find files but do not select them.

The current window is split across all files marked, as evenly as possible.
Remaining lines go to bottom-most window.  The number of files that can be
displayed this way is restricted by the height of the current window and
`window-min-height'.

To keep dired buffer displayed, type C-x 2 first.
To display just marked files, type C-x 1 first.

dired-xがロードされた後、使用するだけM-x dired-do-find-marked-files RETで、質問が求めているものを正確に取得できます。マークされたすべてのファイルはdired-find-file、それらすべてで実行したかのようにアクセスされます。

于 2010-09-15T06:58:29.580 に答える
25

これを .emacs に追加すると、キーバインド '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」をオーバーライドできます。

于 2009-07-10T16:06:44.717 に答える
6

複数のファイルを選択してすべてを検索/表示する機能など、diredに多くの拡張機能を提供するdired+を試すことができます。

于 2009-07-11T04:14:41.630 に答える