bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#46884: [PATCH] 27.1; Cannot run find-dired with -maxdepth


From: Allen Li
Subject: bug#46884: [PATCH] 27.1; Cannot run find-dired with -maxdepth
Date: Wed, 3 Mar 2021 03:38:49 +0000

On Wed, Mar 3, 2021 at 1:20 AM Allen Li <darkfeline@felesatra.moe> wrote:
>
> Some additional context: I'm not asking for find-dired to support -maxdepth necessarily, but the way find-dired is structured makes it impossible to reuse any of the code to write a command that could support -maxdepth.
>
> I attached a patch pulling most of the find-dired logic into a find-dired-unescaped function so that it can be readily reused.

I made a mistake in my initial analysis. find (at least the version I have) allows one to pass global options such as -maxdepth like so:

    find . \( -maxdepth 3 ARGS \) -ls

However, find will print a warning message as this usage is not recommended.

Also, I realized that my previous patch, while functional, is awkward since it exists solely to allow users to specify global options 
(based on the discussion on #27456, I believe all other find functionality should be possible with find-dired).
I have made a new patch adding an optional parameter to find-dired for passing such global options to find.

Aside: there is a discussion at #32668 about adding a similar command line editing feature like rgrep
I'm not fond of that as it is impossible to use programmatically and interacts poorly (read: not at all)
with `repeat-complex-command'

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27456

Attachment: 0001-find-dired-Add-global-args-to-find-dired.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]