From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#46884: [PATCH] 27.1; Cannot run find-dired with -maxdepth Date: Wed, 3 Mar 2021 08:22:23 +0000 Message-ID: References: <83k0qo699n.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008d40e005bc9d8dad" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7333"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46884@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 03 09:23:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHMmk-0001nJ-Ad for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Mar 2021 09:23:10 +0100 Original-Received: from localhost ([::1]:35612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lHMmi-0001Ro-UX for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Mar 2021 03:23:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHMmc-0001Rf-Gm for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2021 03:23:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHMmc-00080g-9m for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2021 03:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lHMmc-0006u5-62 for bug-gnu-emacs@gnu.org; Wed, 03 Mar 2021 03:23:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Mar 2021 08:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46884 X-GNU-PR-Package: emacs Original-Received: via spool by 46884-submit@debbugs.gnu.org id=B46884.161475976426498 (code B ref 46884); Wed, 03 Mar 2021 08:23:02 +0000 Original-Received: (at 46884) by debbugs.gnu.org; 3 Mar 2021 08:22:44 +0000 Original-Received: from localhost ([127.0.0.1]:55088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHMmK-0006tK-Al for submit@debbugs.gnu.org; Wed, 03 Mar 2021 03:22:44 -0500 Original-Received: from mail-oi1-f175.google.com ([209.85.167.175]:36374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lHMmF-0006t4-W3 for 46884@debbugs.gnu.org; Wed, 03 Mar 2021 03:22:43 -0500 Original-Received: by mail-oi1-f175.google.com with SMTP id j1so25102148oiw.3 for <46884@debbugs.gnu.org>; Wed, 03 Mar 2021 00:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Cd6aGLQtBPeeL636Lg4G+eKUf2mkBUZdY7RceiDLrKM=; b=VW2MACayW9nt5iEzx6Iea39x6jvA2n3wkpVKNKWp2aOkqtoOq/dgtzyMW5ObFOPWSG xC5aBGmroQdbdfnp1X2o1izrjzy28Nb2r6LvMva3aj0Nr1kEBbrtR40qGSnRwqz/w0+6 I1AQn8nUnGY2FI5ZIcAuHIN8vhABV4HcRTKJiCi1XYN9FAKiJjnaKhfxfJ9dKzLPiJAA VlG0Q7Zp1Y9XVnOJDHyxJQ73mo8VaKgrF/Ey8PTMSBYU7SJC4CFp1aAFMCpQ4Z2YU9oV 8+NWLE/UF5tDbhtw2LRbPKmht/wIM6wYIoWzWjmufT4DIenweAwecKodRrxx1lUYwGiD Ve5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Cd6aGLQtBPeeL636Lg4G+eKUf2mkBUZdY7RceiDLrKM=; b=E5dfhVM+8yQilxTaYYnSJeptSTK/vMKme36vrfmIQohjAwazBC/SV81SU3Q8kAtdZ/ xviZaDgOCRBcJlNh1K7IKUdMppr1e/e9xia1U/cdc7NwFboSA73lZSPXwevEYqSiUkEj HZh0ejlFpgbrJa9ADjDSVxUDCiMy7j0WaXXZc0Rec27KE+FOZsaJekk8oNCvbKi/E8oC 55Ul0I26eNrYC7GS/9lOlZ5SruGwViATHUEi7of8kVrF9X9xyaVuqOk8AsqbkPs5HtN9 D/7HQdv8iQXhS5jO4Y46Jr1uLNiuvr3V82sfTOaS2nnGM47whEBla9dC4OFLu9jx1sZm /vOg== X-Gm-Message-State: AOAM531U3B6y/FbiSg5MpoMgksl492F0+bf00/i786284MDahyYs7mCs iCCfeaCMqkYmEbMeE75hNi2By2ljTsVKHHLsNZweFy7eStk= X-Google-Smtp-Source: ABdhPJzXnlpJhC8Fhg71OgrwhpX0qwqjeZbCgtYt5WEnkPln9Pk5W+bF6sWF7eKnN2t9/X3O/s1Tqm2Tvrmlq+u6lT0= X-Received: by 2002:a05:6808:214:: with SMTP id l20mr6407800oie.178.1614759754280; Wed, 03 Mar 2021 00:22:34 -0800 (PST) In-Reply-To: <83k0qo699n.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:201262 Archived-At: --0000000000008d40e005bc9d8dad Content-Type: text/plain; charset="UTF-8" On Wed, Mar 3, 2021 at 6:28 AM Eli Zaretskii wrote: > > From: Allen Li > > Date: Wed, 3 Mar 2021 03:38:49 +0000 > > > > -(defun find-dired (dir args) > > +(defun find-dired (dir args &optional global-args) > > "Run `find' and go into Dired mode on a buffer of the output. > > The command run (after changing into DIR) is essentially > > > > - find . \\( ARGS \\) -ls > > + find . GLOBAL-ARGS \\( ARGS \\) -ls > > > > except that the car of the variable `find-ls-option' specifies what to > > -use in place of \"-ls\" as the final argument. > > +use in place of \"-ls\" as the final argument. GLOBAL-ARGS is empty > > +when called interactively. > > This is okay, IMO, but it would be better to allow the user to specify > GLOBAL-ARGS interactively if the user invokes the command with a > prefix argument. > How would that interact with find-args-history? I could create a separate history variable, but then it's annoying how the two histories are separate, as args and global-args together form one query. I decided to punt on that issue until someone actually has a use case for providing global-args interactively. I would use global-args infrequently enough that I would rather call find-dired via M-x and iterate on getting the command right that way, than try to call find-dired interactively repeatedly with a universal prefix arg and navigating the history for both the completing-reads for args and global-args separately. Or I would add the -maxdepth flag to the args and tolerate the warning in the output. Actually, my current use case is calling find-dired from Emacs Lisp code (not interactively) where I want to avoid the warning. --0000000000008d40e005bc9d8dad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Mar 3, 2021 at 6:28 AM Eli Zarets= kii <eliz@gnu.org> wrote:
> From: Allen Li <darkfeline@felesatra.moe>
> Date: Wed, 3 Mar 2021 03:38:49 +0000
>
> -(defun find-dired (dir args)
> +(defun find-dired (dir args &optional global-args)
>=C2=A0 =C2=A0 "Run `find' and go into Dired mode on a buffer o= f the output.
>=C2=A0 The command run (after changing into DIR) is essentially
>=C2=A0
> -=C2=A0 =C2=A0 find . \\( ARGS \\) -ls
> +=C2=A0 =C2=A0 find . GLOBAL-ARGS \\( ARGS \\) -ls
>=C2=A0
>=C2=A0 except that the car of the variable `find-ls-option' specifi= es what to
> -use in place of \"-ls\" as the final argument.
> +use in place of \"-ls\" as the final argument.=C2=A0 GLOBAL= -ARGS is empty
> +when called interactively.

This is okay, IMO, but it would be better to allow the user to specify
GLOBAL-ARGS interactively if the user invokes the command with a
prefix argument.

=C2=A0How would that i= nteract with find-args-history?=C2=A0 I could create a separate history var= iable, but then it's annoying how the two histories are separate, as ar= gs and global-args together form one query.=C2=A0 I decided to punt on that= issue until someone actually has a use case for providing global-args inte= ractively.=C2=A0 I would use global-args infrequently enough that I would r= ather call find-dired via M-x and iterate on getting the command right that= way, than try to call find-dired interactively repeatedly with a universal= prefix arg and navigating the history for both the completing-reads for ar= gs and global-args separately.=C2=A0 Or I would add the -maxdepth flag to t= he args and tolerate the warning in the output.=C2=A0 Actually, my current = use case is calling find-dired from Emacs Lisp code (not interactively) whe= re I want to avoid the warning.
--0000000000008d40e005bc9d8dad--