From 29bb72f0432c7b89d2f7dec5022c582f8e10ada9 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Sat, 22 Aug 2020 17:39:16 +0200 Subject: Handle globstar in dired Allow user to enable globstar when the shell support it and disable it by default (e.g. bash). * lisp/dired.el (dired-maybe-use-globstar): New user option. (dired-enable-globstar-in-shell): New variable. (dired-insert-directory): if `dired-maybe-use-globstar' is non-nil and the shell supports globstar, then enable it. * doc/emacs/dired.texi: Document feature. ; * etc/NEWS: Add entry. --- doc/emacs/dired.texi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doc/emacs') diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index de449e31c37..39caab086c2 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -79,6 +79,24 @@ The former lists all the files with extension @samp{.el} in directory @samp{foo}. The latter lists the files with extension @samp{.el} in all the subdirectories of @samp{foo}. +When the system shell supports globstar and it's enabled, then you +can use recursive globbing: + +@example +C-x d ~/foo/**/*.el @key{RET} +@end example + +This command lists all the files with extension @samp{.el} descending +recursively in all the subdirectories of @samp{foo}. Note that there +are small differences in the implementation of globstar between shells. +Check your shell manual to know the expected behavior. + +@vindex dired-maybe-use-globstar +@vindex dired-enable-globstar-in-shell +If the shell supports globstar and disables it by default, you +can still enable this feature with @code{dired-maybe-use-globstar} if +the shell is included in @code{dired-enable-globstar-in-shell}. + The usual history and completion commands can be used in the minibuffer; in particular, @kbd{M-n} puts the name of the visited file (if any) in the minibuffer (@pxref{Minibuffer History}). -- cgit v1.2.3