From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#32668: bug#27456: 25.2; Not possible to use -prune with find-dired Date: Sun, 9 Sep 2018 07:04:26 -0700 (PDT) Message-ID: <0b2d5d16-846e-4711-b1c4-0030a6871b7e@default> References: <87k243qm3z.fsf@felesatra.moe> <87lg8bz96e.fsf@web.de> <4a51546f-d4b6-739e-5cc2-55c5f5694b33@orcon.net.nz> <87in3fi6cc.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1536501799 21328 195.159.176.226 (9 Sep 2018 14:03:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2018 14:03:19 +0000 (UTC) Cc: 27456@debbugs.gnu.org, 32668@debbugs.gnu.org, darkfeline@felesatra.moe To: Phil Sainty , Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 09 16:03:14 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fz0Iz-0005RD-HC for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Sep 2018 16:03:13 +0200 Original-Received: from localhost ([::1]:47546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fz0L5-0003pl-LG for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Sep 2018 10:05:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fz0Kv-0003pZ-6h for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 10:05:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fz0Kn-0003cg-IQ for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 10:05:11 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46386) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fz0Kl-0003W2-3X for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 10:05:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fz0Kk-0003lD-T2 for bug-gnu-emacs@gnu.org; Sun, 09 Sep 2018 10:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Sep 2018 14:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32668 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32668-submit@debbugs.gnu.org id=B32668.153650188414409 (code B ref 32668); Sun, 09 Sep 2018 14:05:02 +0000 Original-Received: (at 32668) by debbugs.gnu.org; 9 Sep 2018 14:04:44 +0000 Original-Received: from localhost ([127.0.0.1]:51401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fz0KS-0003kJ-3S for submit@debbugs.gnu.org; Sun, 09 Sep 2018 10:04:44 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:51352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fz0KQ-0003k2-Fu; Sun, 09 Sep 2018 10:04:42 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w89E3c6X115792; Sun, 9 Sep 2018 14:04:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=a2sjsKrvEZVaQch4AkUbEA8lx0V9eeSAWRfS58zrMJU=; b=a+EeJWfg6RhhAqO1iHe1RYodeS3j5t8oYWQydzMfJwEqOi9JMFRVox3gyBv89YwCuPZh JppTsV5uuxwqYZVnFhtcmX2au3YlaDXXbZ91SRI1OG9LlWSgG+hgWZorCNITWSYU29vY QmNeA/y5J4stoY/YQr4zF7VuxaBVKLf9irA8HulxIMdJnTG5CYc+ygJa+LmV7Qn+a7H9 jflTCyR44uCYBOHocFlq/UAjhWcPSomQ2pIsNE7FReckJjGEWzvzO+UcvHfMz0M9YQ3A +FcjHdUx2MtqlOuya2enmQhSYCoArsAASXEbSJaJ01PU+hf1hP+qJPdXIi3pS09QvIKM 3Q== Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2mc72qae0x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 09 Sep 2018 14:04:34 +0000 Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w89E4TKt031275 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 9 Sep 2018 14:04:29 GMT Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w89E4R7k000604; Sun, 9 Sep 2018 14:04:27 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4735.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9010 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809090155 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:150159 Archived-At: > For now I have raised this as bug#32668: 26.1; Give find-dired prefix > argument behaviour equivalent to that of rgrep FWIW, in my library `find-dired+.el', which adds to `find-dired.el', `find-dired' acts as follows (`C-h f find-dired'): ------8<--------------- find-dired is an interactive Lisp function in =E2=80=98find-dired+.el=E2=80= =99.=20 (find-dired DIR ARGS &optional DEPTH-LIMITS EXCLUDED-PATHS) Run =E2=80=98find=E2=80=99 and put its output in a buffer in Dired Mode. Then run =E2=80=98find-dired-hook=E2=80=99 and =E2=80=98dired-after-readin-= hook=E2=80=99. The =E2=80=98find=E2=80=99 command run (after changing into DIR) is essenti= ally this, where LS-SWITCHES is =E2=80=98(car find-ls-option)=E2=80=99: find . \( ARGS \) LS-SWITCHES Optional args: * DEPTH-LIMITS: Minimum and maximum depths: (MIN-DEPTH MAX-DEPTH). * EXCLUDED-PATHS: Strings matching paths to be excluded. Uses =E2=80=98find=E2=80=99 switch =E2=80=98-path=E2=80= =99. When both optional args are non-nil, the =E2=80=98find=E2=80=99 command run= is this: find . -mindepth MIN-DEPTH -maxdepth MAX-DEPTH \( -path EXCLUDE1 -o -path EXCLUDE2 ... \) -prune -o \( ARGS \) LS-SWITCHES where EXCLUDE1, EXCLUDE2... are the EXCLUDED-PATHS, but shell-quoted. ------8<--------------- The same is true for `find-name-dired' and `find-grep-dired' - they make th= e same use of `-prune', as does the new command `find-time-dired' (`C-h f')= : ------8<--------------- find-time-dired is an interactive Lisp function in =E2=80=98find-dired+.el= =E2=80=99. =20 (find-time-dired DIR MIN-TIME MAX-TIME &optional DEPTH-LIMITS EXCLUDED-PATHS) Find files in directory DIR newer or older than a timestamp. The output is shown in a Dired buffer. MIN-TIME is a format-time string parsable by =E2=80=98parse-time-string=E2= =80=99, such as "2014-12-25 23:59:00". Only files newer than this are shown. If MIN-TIME is nil or a string matching regexp "^\s-*$", there is no lower time limit. MAX-TIME is also a format-time string parsable by =E2=80=98parse-time-strin= g=E2=80=99. Only files older than this time are shown. If MAX-TIME is nil or a string matching regexp "^\s-*$", the upper time limit is the current system time. Optional arg DEPTH-LIMITS is a list (MIN-DEPTH MAX-DEPTH) of the minimum and maximum depths. If nil, search directory tree under DIR. Optional arg EXCLUDED-PATHS is a list of strings that match paths to exclude from the search. If nil, search all directories. If args DEPTH-LIMITS and EXCLUDED-PATHS are both non-nil then the command run is essentially the following: find . -mindepth MIN-DEPTH -maxdepth MAX-DEPTH \( -path EXCLUDE1 -o -path EXCLUDE2 ... \) -prune -o \( -TIME-SWITCH -SINCE-MIN -TIME-SWITCH +SINCE-MAX \) LS-SWITCHES where: * EXCLUDE1, EXCLUDE2... are the EXCLUDED-PATHS, but shell-quoted. * TIME-SWITCH is =E2=80=98find-diredp-time-prefix=E2=80=99 concatenated wit= h "min". * SINCE-MIN is the elapsed time since MIN-TIME in minutes. * SINCE-MAX is the elapsed time since MAX-TIME in minutes. * LS-SWITCHES is =E2=80=98(car find-ls-option)=E2=80=99. ------8<--------------- This code was improved by Tino Calancha. Without having studied the bug threads of #27456 or #32668, this sounds relevant. If it helps I can offer this code, as a patch or as is. The code is here: https://www.emacswiki.org/emacs/download/find-dired%2b.el