From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Trent W. Buck" Newsgroups: gmane.emacs.bugs Subject: bug#4403: 23.1; find-dired: use "find -exec ls -ld {} +" or "find -ls" where available Date: Tue, 15 Sep 2009 14:55:18 +1000 Message-ID: <20090915045518.GA4680@Clio> References: <4aaa13d9.11045a0a.0cdc.4719@mx.google.com> Reply-To: "Trent W. Buck" , 4403@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253024680 14888 80.91.229.12 (15 Sep 2009 14:24:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Sep 2009 14:24:40 +0000 (UTC) Cc: 4403@emacsbugs.donarmstrong.com To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 15 16:24:32 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MnYxL-0003AX-7o for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Sep 2009 16:24:32 +0200 Original-Received: from localhost ([127.0.0.1]:58079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnYxK-00005v-KH for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Sep 2009 10:24:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnQFw-0006IF-MT for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2009 01:07:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnQFr-00069m-Sh for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2009 01:07:07 -0400 Original-Received: from [199.232.76.173] (port=55104 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnQFr-000690-Kq for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2009 01:07:03 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:57018) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MnQFq-0001lG-UA for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2009 01:07:03 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8F570Jh012530; Mon, 14 Sep 2009 22:07:00 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8F55H3L012017; Mon, 14 Sep 2009 22:05:18 -0700 Resent-Date: Mon, 14 Sep 2009 22:05:18 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Trent W. Buck" Original-Sender: "Trent W. Buck" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Tue, 15 Sep 2009 05:05:16 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4403 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4403-submit@emacsbugs.donarmstrong.com id=B4403.12529905339872 (code B ref 4403); Tue, 15 Sep 2009 05:05:16 +0000 Original-Received: (at 4403) by emacsbugs.donarmstrong.com; 15 Sep 2009 04:55:33 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.210.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8F4tVDb009855 for <4403@emacsbugs.donarmstrong.com>; Mon, 14 Sep 2009 21:55:33 -0700 Original-Received: by yxe12 with SMTP id 12so5287327yxe.1 for <4403@emacsbugs.donarmstrong.com>; Mon, 14 Sep 2009 21:55:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=QWUKIVvGu5XYmDxzULZyVG+5T69fKZA+/fLgRtJrYQA=; b=B7hZjA+7VsT/wCL5wK9jtSucqRmkxf8UKM+XAzGieJRBgc8kHqHYdKRoHuvdH8JsAq 4LXnKy4D7QDHfGfO8n2ey+VutMPwM9iBv8a0eAVJhmzzGGo7pHGsDcePmnXTPUMWYFkG YOMeCqggxfy7u/4Wu5DUJgR1bz4G6ujhsW1Tc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=kHNqIKH82abckodLA8BpO0BrTIfzp5QWWlgb+8JjoLF23+qBEsNMONgxmoFouFxm6d XStyHPT/wg5LoDCFyz9RHIOGwmtUBvKE+XgM8fCTsV8HuByrXno1UbR9/KKVbqvkLR6a /AeaMYpBZv5QqQXkTsG1l2Ar2qBvbwLo7eL2A= Original-Received: by 10.91.143.18 with SMTP id v18mr4344563agn.71.1252990526514; Mon, 14 Sep 2009 21:55:26 -0700 (PDT) Original-Received: from localhost (nat064.cyber.com.au [203.7.155.64]) by mx.google.com with ESMTPS id 7sm5966289agb.41.2009.09.14.21.55.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 14 Sep 2009 21:55:25 -0700 (PDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 15 Sep 2009 01:07:07 -0400 X-Mailman-Approved-At: Tue, 15 Sep 2009 10:24:00 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31116 Archived-At: On Mon, Sep 14, 2009 at 10:50:04PM -0400, Glenn Morris wrote: >> It would be great if M-x find dired RET automatically > > You can use something like: > > (setq find-ls-option > (let ((help (shell-command-to-string (format "%s --help" find-program)))) > (if (string-match " -ls\\>" help) > '("-ls" . "-lids") > (if (string-match "{} \\+" help) > '("-exec ls -ld {} +" . "-ld") > '("-exec ls -ld {} \\;" . "-ld"))))) True. I guess I should have mentioned: I tried that a couple of years ago, but it broke down when I tried TRAMP to a host that doesn't support -exec {} + -- namely some FC3 and CentOS 4 servers. I suppose that's really a separate TRAMP wishlist bug. (The same thing happens with setting dired-listing-switches to "-Alh", but I very rarely connect to a non-GNU server.) > The -ls version changes the output format. > >> It would also mean that the output would line up better > > Surely dired already takes care of the alignment? Nope. AFAIK M-x dired is aligned only because ls(1) handles alignment. find-dired isn't aligned because ls(1) is called on files one at a time. In some environments, GNU ls called on a single file would align to a tab stop, so find-dired still *mostly* aligned things nicely. Some (recent? locale-dependent?) versions didn't align to a tab stop, so find-dired output was very hard to read, being completely unaligned. UPDATE: apparently I was wrong, because this is aligned normally, but broken in find-dired: find . \( -type d \) -exec ls -ldh {} + (setq find-ls-option '("-exec ls -ldh {} +" . "-ldh")) e.g. dired: drwxr-xr-x 2 twb twb 12K 2009-07-06 13:53 SinFest drwxr-xr-x 2 twb twb 4.0K 2009-09-01 21:55 VGCats drwxr-xr-x 2 twb twb 12K 2009-09-15 11:39 xkcd vs. find directly in shell: drwxr-xr-x 2 twb twb 12K 2009-07-06 13:53 ./SinFest drwxr-xr-x 2 twb twb 4.0K 2009-09-01 21:55 ./VGCats drwxr-xr-x 2 twb twb 12K 2009-09-15 11:39 ./xkcd