File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -550,6 +550,7 @@ These narrowing functions are provided:
550550* ` dired-narrow `
551551* ` dired-narrow-regexp `
552552* ` dired-narrow-fuzzy `
553+ * ` dired-narrow-completion-styles `
553554
554555You can also create your own narrowing functions quite easily. To
555556define new narrowing function, use ` dired-narrow--internal ` and
Original file line number Diff line number Diff line change @@ -276,6 +276,17 @@ read from minibuffer."
276276 (interactive )
277277 (dired-narrow--internal 'dired-narrow--regexp-filter ))
278278
279+ (defun dired-narrow--completion-styles-filter (filter )
280+ " Return whether `completion-styles' FILTER matches the current dired file."
281+ (completion-all-completions filter (list (dired-utils-get-filename 'no-dir ))
282+ nil (length filter)))
283+
284+ ;;;### autoload
285+ (defun dired-narrow-completion-styles ()
286+ " Narrow a dired buffer to the files matching a `completion-styles' query."
287+ (interactive )
288+ (dired-narrow--internal #'dired-narrow--completion-styles-filter ))
289+
279290(defun dired-narrow--string-filter (filter )
280291 (let ((words (split-string filter " " )))
281292 (--all? (save-excursion (search-forward it (line-end-position ) t )) words)))
You can’t perform that action at this time.
0 commit comments