From 0c83c56bd51a091cf7841d5f54ccd6b346316a77 Mon Sep 17 00:00:00 2001 From: condy Date: Wed, 14 Aug 2024 01:24:43 +0800 Subject: [PATCH] Use find-dired --- lisp/init-shell.el | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lisp/init-shell.el b/lisp/init-shell.el index 48ba128..5656b7f 100644 --- a/lisp/init-shell.el +++ b/lisp/init-shell.el @@ -63,16 +63,13 @@ (defun eshell/f (filename &optional dir) "Search for files matching FILENAME in either DIR or the current directory." - (let ((cmd (concat - (executable-find "find") - " " (or dir ".") - " -not -path '*/.git*'" - " -and -not -path 'build'" ;; the cmake build directory - " -and" - " -type f" - " -and" - " -iname '*" (format "%s" filename) "*'"))) - (eshell-command-result cmd))) + (find-dired (or dir ".") + (concat " -not -path '*/.git*'" + " -and -not -path 'build'" ;; the cmake build directory + " -and" + " -type f" + " -and" + " -iname " (format "'*%s*'" filename)))) (defun eshell/z () "cd to directory with completions."