From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Magolske Newsgroups: gmane.emacs.help Subject: Re: counsel-dired-jump error "find: paths must precede expression:" Date: Fri, 19 Jan 2018 00:13:02 -0800 Message-ID: <20180119081302.55smxz7fuoon4433@s70206.gridserver.com> References: <20180118023907.ccrcmi6gizigzhr6@s70206.gridserver.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1516349511 23560 195.159.176.226 (19 Jan 2018 08:11:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 19 Jan 2018 08:11:51 +0000 (UTC) User-Agent: NeoMutt/20170113 (1.7.2) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 19 09:11:47 2018 Return-path: Envelope-to: geh-help-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 1ecRlx-0005Kx-Jd for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Jan 2018 09:11:37 +0100 Original-Received: from localhost ([::1]:33800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecRnu-0007M7-Kl for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Jan 2018 03:13:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecRnT-0007L8-U8 for help-gnu-emacs@gnu.org; Fri, 19 Jan 2018 03:13:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecRnP-0000sl-N2 for help-gnu-emacs@gnu.org; Fri, 19 Jan 2018 03:13:11 -0500 Original-Received: from mail6.webfaction.com ([31.170.123.134]:54244 helo=smtp.webfaction.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ecRnP-0000oZ-HD for help-gnu-emacs@gnu.org; Fri, 19 Jan 2018 03:13:07 -0500 Original-Received: from localhost (50-0-151-74.dsl.dynamic.fusionbroadband.com [50.0.151.74]) by smtp.webfaction.com (Postfix) with ESMTPSA id 9237E60744639 for ; Fri, 19 Jan 2018 08:13:04 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 31.170.123.134 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115784 Archived-At: Thanks for the clarifying explanation, * Yuri Khan [180117 23:14]: > The source of =91counsel-dired-jump=92: >=20 > https://github.com/abo-abo/swiper/blob/master/counsel.el#L2183 >=20 > contains this expression: >=20 > (shell-command-to-string > (concat find-program " * -type d -not -path '*\/.git*'")) >=20 > The * in the first argument will be expanded by the shell to a list of > all files in the current directory, in unspecified order. If any of > them happens to look like a =91find=92 option, =91find=92 will try to > interpret it as one, with unintended consequences. looking into this further, I found a quoted wildcard resolves the issue: (shell-command-to-string (concat find-program " -path './*' -type d -not -path '*\/.git*'")) Seems to behave pretty much the same, except that all the directory file-paths displayed in the minibuffer are now preceded with a ./ > [...] > > I was also able to cause data loss: >=20 > ~$ mkdir /tmp/bar > ~$ cd /tmp/bar > /tmp/bar$ touch -- aaa bbb ccc -delete > /tmp/bar$ ls > aaa bbb ccc -delete > /tmp/bar$ find * -type d -not -path '*/.git*' > /tmp/bar$ ls > -delete --=20 John Magolske http://b79.net/contact