From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: counsel-dired-jump error "find: paths must precede expression:" Date: Fri, 19 Jan 2018 12:07:39 +0200 Message-ID: <83y3kutb4k.fsf@gnu.org> References: <20180118023907.ccrcmi6gizigzhr6@s70206.gridserver.com> <20180119081302.55smxz7fuoon4433@s70206.gridserver.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1516356412 19648 195.159.176.226 (19 Jan 2018 10:06:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 19 Jan 2018 10:06:52 +0000 (UTC) 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 11:06:48 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 1ecTZH-0004H2-J4 for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Jan 2018 11:06:39 +0100 Original-Received: from localhost ([::1]:39768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecTbF-00011K-Bm for geh-help-gnu-emacs@m.gmane.org; Fri, 19 Jan 2018 05:08:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecTaf-00010P-IE for help-gnu-emacs@gnu.org; Fri, 19 Jan 2018 05:08:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecTab-0000Pt-CQ for help-gnu-emacs@gnu.org; Fri, 19 Jan 2018 05:08:05 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44224) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecTab-0000Pg-8F for help-gnu-emacs@gnu.org; Fri, 19 Jan 2018 05:08:01 -0500 Original-Received: from [176.228.60.248] (port=2008 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ecTaa-0002sP-NF for help-gnu-emacs@gnu.org; Fri, 19 Jan 2018 05:08:01 -0500 In-reply-to: <20180119081302.55smxz7fuoon4433@s70206.gridserver.com> (message from John Magolske on Fri, 19 Jan 2018 00:13:02 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:115790 Archived-At: > Date: Fri, 19 Jan 2018 00:13:02 -0800 > From: John Magolske > > > https://github.com/abo-abo/swiper/blob/master/counsel.el#L2183 > > > > contains this expression: > > > > (shell-command-to-string > > (concat find-program " * -type d -not -path '*\/.git*'")) > > > > 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 ‘find’ option, ‘find’ 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*'")) Beware: this uses quoting that will fail on non-Posix hosts. For portable code, always use shell-quote-argument instead of literal quotes and backslash-escapes.