From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46884: [PATCH] 27.1; Cannot run find-dired with -maxdepth Date: Sat, 13 Mar 2021 11:46:38 +0200 Message-ID: <831rcjjsht.fsf@gnu.org> References: <83k0qo699n.fsf@gnu.org> <83ft1c62hk.fsf@gnu.org> <80ft1bed4g.fsf@felesatra.moe> <87r1kv8dnt.fsf@mail.linkov.net> <808s72e14s.fsf@felesatra.moe> <835z26ysa5.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34195"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46884@debbugs.gnu.org, juri@linkov.net To: Allen Li Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 13 10:47:17 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 1lL0rd-0008ns-0Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 10:47:17 +0100 Original-Received: from localhost ([::1]:40118 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lL0rc-0006TU-3z for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 04:47:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33834) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lL0rO-0006Rw-HE for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 04:47:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47547) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lL0rO-0006V4-9Z for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 04:47:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lL0rO-00048l-7K for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 04:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Mar 2021 09:47: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.161562880015884 (code B ref 46884); Sat, 13 Mar 2021 09:47:02 +0000 Original-Received: (at 46884) by debbugs.gnu.org; 13 Mar 2021 09:46:40 +0000 Original-Received: from localhost ([127.0.0.1]:59093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lL0r2-000488-Da for submit@debbugs.gnu.org; Sat, 13 Mar 2021 04:46:40 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lL0r1-00047x-MX for 46884@debbugs.gnu.org; Sat, 13 Mar 2021 04:46:40 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60281) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lL0qv-0006DR-HT; Sat, 13 Mar 2021 04:46:33 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2499 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lL0qu-00062b-Sd; Sat, 13 Mar 2021 04:46:33 -0500 In-Reply-To: (message from Allen Li on Fri, 12 Mar 2021 08:08:55 +0000) 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:202247 Archived-At: > From: Allen Li > Date: Fri, 12 Mar 2021 08:08:55 +0000 > Cc: Juri Linkov , 46884@debbugs.gnu.org > > Attached patch, does this approach look good? I guess my suggestion to additionally allow specification of GLOBAL-ARGS interactively (via prefix arg) got voted down? > +--- > +*** Optional 'global-args' parameter added to 'find-dired'. > +This allows passing find global options like -maxdepth. "find" should be in quotes: 'find' > @@ -202,6 +203,7 @@ find-dired > (setq default-directory dir > find-args args ; save for next interactive call > args (concat find-program " . " > + (if global-args global-args "") 'concat' knows how to handle nil arguments, so you don't need the empty string alternative here. Just (if global-args global-args) should do.