From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: counsel-dired-jump error "find: paths must precede expression:" Date: Thu, 18 Jan 2018 13:46:48 +0700 Message-ID: References: <20180118023907.ccrcmi6gizigzhr6@s70206.gridserver.com> 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 1516257951 15425 195.159.176.226 (18 Jan 2018 06:45:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2018 06:45:51 +0000 (UTC) Cc: help-gnu-emacs To: John Magolske Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 18 07:45:46 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 1ec3xE-0003Hu-6N for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 07:45:40 +0100 Original-Received: from localhost ([::1]:38125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec3zC-0004Hx-H8 for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 01:47:42 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec3yh-0004Ha-E0 for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 01:47:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ec3yg-0007EY-C0 for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 01:47:11 -0500 Original-Received: from mail-ot0-x235.google.com ([2607:f8b0:4003:c0f::235]:44617) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ec3yg-0007EB-6F for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 01:47:10 -0500 Original-Received: by mail-ot0-x235.google.com with SMTP id t20so9823377ote.11 for ; Wed, 17 Jan 2018 22:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=G+lHUo4lHg04KZSw7uaUpz4DbyGTzwcdkZv3SQHP4dw=; b=lf//QlYz3oo+ycInDoC1dtH/NQWpuzIZmHQA9s/xk4Ug8biFU7ZfGWBqsIVLXFiXcA G0jLikX/Mb4a5HOCMBTAd+TT688g6/9oz6nkR5FJ1hVPf3vljc84QajxgdS7EclB4KQx Cig6JF4NpSYNFwu9hFajanb3/YsOV4qzr/tKkGmu1BFvRXKF+SAbE4wRNxjlASY2yeO8 QCr2ebBL3qBkcGdbT4Ap15NFw+QWuRYft3ltJp4yOELHaL6kXmFdczLyo0ZoUO6x0h84 n96LuqAdjiF5U9A/7JEcy/WVeazIDmeCvKqxxMIU0Fa4n9Y2JBmtBdVCfHqIMcZqWtAF EaRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=G+lHUo4lHg04KZSw7uaUpz4DbyGTzwcdkZv3SQHP4dw=; b=QBNlv+0Ey3XxCMCsIuHQvap/Aqa1Utf1CLZ3+b0YEdH81dyI+oxtGDzNJ3XEsDQZHF m3Oiwx1jC6Yj6hIO/kRKqe3BBqlx4IbPO0GviKKuaYaKCnHtoZYQfanWQtnpSQ9BECYq banDdo4JSBeaIsnSJ+2U2SghuqtuINK+LzU2Oq5CElevSd5L43MPxdUI+Uws/vG3FHlY ZZEG6eXwHTSy4Ya1Ju5U0lb1EJeisA0MZ2qYKOaKvP11bVQKB5lBlzBRguPAfJZD+3Ok Nkf3lNj9UQE1QQm7KdceHUHrQPS6hJnPOl/HW8PBfTeQUk/JcRfi4845OB805c1I9Xa7 zh3Q== X-Gm-Message-State: AKwxytcfnNNcIJj4imRy+TnF2MQjtamp3N2dCjI5/l9jpRkK165g//Cp cUv/Huyv44nUsVyNKeQQiuYXQa7n2Z+y5IVW+Pw= X-Google-Smtp-Source: ACJfBov/FMaDpY67J2zyWUW9uO2483OQlWFV/FbhgCT+Pe1h6JmF80RFNOF3hEIeVq/86r57iueceXqBPfBehzLWdMI= X-Received: by 10.157.12.104 with SMTP id 95mr2905314otr.26.1516258028867; Wed, 17 Jan 2018 22:47:08 -0800 (PST) Original-Received: by 10.74.121.148 with HTTP; Wed, 17 Jan 2018 22:46:48 -0800 (PST) In-Reply-To: <20180118023907.ccrcmi6gizigzhr6@s70206.gridserver.com> X-Google-Sender-Auth: EwQSLle3tSzv6jFyVqd2LWE-EYw X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c0f::235 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:115769 Archived-At: On Thu, Jan 18, 2018 at 9:39 AM, John Magolske wrote: > When issuing the command counsel-dired-jump from some directories I'll > get this error message: > > find: paths must precede expression: A1 > Try 'find --help' for more information. > > yet from other directories the command works fine, allowing fuzzy > searching for a directory to open dired at. I can't sort out why > this error message comes up in some directories and not others... The source of =E2=80=98counsel-dired-jump=E2=80=99: 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 =E2=80=98find=E2=80=99 option, =E2=80=98find=E2= =80=99 will try to interpret it as one, with unintended consequences. For example, on my system the following example breaks with the message you quoted: ~$ mkdir /tmp/foo ~$ cd /tmp/foo /tmp/foo$ touch -- ! A1 /tmp/foo$ echo * ! A1 /tmp/foo$ find * -type d -not -path '*/.git*' find: paths must precede expression: A1 I was also able to cause data loss: ~$ 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