From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#36110: find-dired not sorted on any field nor provides a way Date: Fri, 14 Jun 2019 22:10:23 +0300 Organization: LINKOV.NET Message-ID: <8736kc0yqo.fsf@mail.linkov.net> References: <875zpjipe7.8.fsf@jidanni.org> <87y32efp01.fsf@mail.linkov.net> <87tvd2p7gi.5.fsf@jidanni.org> <87r27xglua.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="236597"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 36110@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 14 21:21:58 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hbrlt-000zOc-As for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jun 2019 21:21:57 +0200 Original-Received: from localhost ([::1]:54642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbrls-0006cd-9h for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Jun 2019 15:21:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39287) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbri8-0003Wf-My for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2019 15:18:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbri7-0002Gz-Fp for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2019 15:18:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52519) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbri7-0002Gn-BJ for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2019 15:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hbri7-0006w1-5v for bug-gnu-emacs@gnu.org; Fri, 14 Jun 2019 15:18:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Jun 2019 19:18:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36110 X-GNU-PR-Package: emacs Original-Received: via spool by 36110-submit@debbugs.gnu.org id=B36110.156053985026569 (code B ref 36110); Fri, 14 Jun 2019 19:18:03 +0000 Original-Received: (at 36110) by debbugs.gnu.org; 14 Jun 2019 19:17:30 +0000 Original-Received: from localhost ([127.0.0.1]:37820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbrhZ-0006uI-No for submit@debbugs.gnu.org; Fri, 14 Jun 2019 15:17:30 -0400 Original-Received: from bongo.birch.relay.mailchannels.net ([23.83.209.21]:63763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hbrhV-0006u6-PH for 36110@debbugs.gnu.org; Fri, 14 Jun 2019 15:17:27 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C5E4B141890; Fri, 14 Jun 2019 19:17:24 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a62.g.dreamhost.com (100-96-85-75.trex.outbound.svc.cluster.local [100.96.85.75]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 2D00C141EC4; Fri, 14 Jun 2019 19:17:24 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a62.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Fri, 14 Jun 2019 19:17:24 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Madly-Trade: 0b576c940966a07b_1560539844487_45106061 X-MC-Loop-Signature: 1560539844487:1754584132 X-MC-Ingress-Time: 1560539844487 Original-Received: from pdx1-sub0-mail-a62.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTP id 97C7E80592; Fri, 14 Jun 2019 12:17:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=H2OcjYuR0C+L2sox9os7xUEbueM=; b= A6zYdaB7uNx8eL/dH6Ow8mbCMivytfJHvvRN34khwMs0fA67w6ygaC/u+WUNykuX 5V6VSosj2PAAhF3N0R484WbaZ13AqYColgUALs6OOgz6wCXNX0uOvZER0/KB6DMU N/oKTitYtlzaHwLKwdCVtIf20ymCplAO19IZo4tU13E= Original-Received: from mail.jurta.org (m91-129-109-209.cust.tele2.ee [91.129.109.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a62.g.dreamhost.com (Postfix) with ESMTPSA id 5591C805A4; Fri, 14 Jun 2019 12:17:17 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a62 In-Reply-To: (Glenn Morris's message of "Thu, 13 Jun 2019 20:12:14 -0400") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudeiuddgudefkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdelrddvtdelnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtledrvddtledprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehrghhmsehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgepud 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: 209.51.188.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:160574 Archived-At: --=-=-= Content-Type: text/plain In addition to the previous patch, it also makes sense to add similar options to grep: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=grep-find-use-xargs.patch diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 79178c4346..67222f7862 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -511,14 +511,24 @@ xargs-program This variable's value takes effect when `grep-compute-defaults' is called.") ;;;###autoload -(defvar grep-find-use-xargs nil +(defcustom grep-find-use-xargs nil "How to invoke find and grep. If `exec', use `find -exec {} ;'. If `exec-plus' use `find -exec {} +'. If `gnu', use `find -print0' and `xargs -0'. +If `gnu-sort', use `find -print0', `sort -z' and `xargs -0'. Any other value means to use `find -print' and `xargs'. -This variable's value takes effect when `grep-compute-defaults' is called.") +This variable's value takes effect when `grep-compute-defaults' is called." + :type '(choice (const :tag "find -exec {} ;" exec) + (const :tag "find -exec {} +" exec-plus) + (const :tag "find -print0 | xargs -0" gnu) + (const :tag "find -print0 | sort -z | xargs -0'" gnu-sort) + string + (const :tag "Not Set" nil)) + :set 'grep-apply-setting + :version "27.1" + :group 'grep) ;; History of grep commands. ;;;###autoload @@ -728,6 +738,9 @@ grep-compute-defaults ;; forward slashes as directory separators. (format "%s . -type f -print0 | \"%s\" -0 %s" find-program xargs-program grep-command)) + ((eq grep-find-use-xargs 'gnu-sort) + (format "%s . -type f -print0 | sort -z | \"%s\" -0 %s" + find-program xargs-program grep-command)) ((memq grep-find-use-xargs '(exec exec-plus)) (let ((cmd0 (format "%s . -type f -exec %s" find-program grep-command)) @@ -752,6 +765,9 @@ grep-compute-defaults (cond ((eq grep-find-use-xargs 'gnu) (format "%s -type f -print0 | \"%s\" -0 %s" find-program xargs-program gcmd)) + ((eq grep-find-use-xargs 'gnu-sort) + (format "%s -type f -print0 | sort -z | \"%s\" -0 %s" + find-program xargs-program gcmd)) ((eq grep-find-use-xargs 'exec) (format "%s -type f -exec %s %s %s%s" find-program gcmd quot-braces null quot-scolon)) --=-=-=--