From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#23959: 25.0.94; find: missing argument to `-exec' Date: Wed, 13 Jul 2016 13:45:15 +0900 (JST) Message-ID: References: <87r3ayodw4.fsf@betacantrips.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: ger.gmane.org 1468385185 28439 80.91.229.3 (13 Jul 2016 04:46:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jul 2016 04:46:25 +0000 (UTC) To: 23959@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 13 06:46:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bNC3r-0003Lg-GU for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jul 2016 06:46:15 +0200 Original-Received: from localhost ([::1]:45128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNC3q-0007B1-KA for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jul 2016 00:46:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNC3j-0007Ak-P7 for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 00:46:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bNC3e-0000ed-Nx for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 00:46:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:36601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bNC3e-0000eZ-KF for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 00:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bNC3e-0002W4-9m for bug-gnu-emacs@gnu.org; Wed, 13 Jul 2016 00:46:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87r3ayodw4.fsf@betacantrips.com> Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Jul 2016 04:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23959 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23959-submit@debbugs.gnu.org id=B23959.14683851289630 (code B ref 23959); Wed, 13 Jul 2016 04:46:02 +0000 Original-Received: (at 23959) by debbugs.gnu.org; 13 Jul 2016 04:45:28 +0000 Original-Received: from localhost ([127.0.0.1]:48938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNC35-0002VG-Sr for submit@debbugs.gnu.org; Wed, 13 Jul 2016 00:45:28 -0400 Original-Received: from mail-pf0-f178.google.com ([209.85.192.178]:34886) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bNC33-0002V0-HP for 23959@debbugs.gnu.org; Wed, 13 Jul 2016 00:45:26 -0400 Original-Received: by mail-pf0-f178.google.com with SMTP id c2so14539957pfa.2 for <23959@debbugs.gnu.org>; Tue, 12 Jul 2016 21:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:subject:message-id:user-agent:mime-version; bh=HsiXL4ZKsPmx5PgzaeLc66gPuDQZoVwJ5gYtauMa63Q=; b=JcnR3hdBEBvBw+fOMnVb2ZQwzEvd7nruy8ZLiM8Ue/83VUpdt1wHHBm1iM58Lgpuvi 4QDPqkYXfXmHuc6SRLR0WjBm+qABw/XMbUF0MIBCVau05xkaaCRs4CEJrOO6emjvgxPv of1yQKPH7FBL/1nQOfH7C7LIXjrw7XlQfadBaqLlDqyroTuoxRldfyMMPYJ319HBjfRk 6YNZnobWjfAzpfBMjHbsuM8lhg0g7v9nV7V/pQofAMVd44klw2OvkKYn8nDLk82ATVmE NMjlcvOHFdYlhPnrSeMaI9zmRovRfE2npxkF7mviYjM47LgoOlJRun6Z26xn4wSF3fmQ p7fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:subject:message-id:user-agent :mime-version; bh=HsiXL4ZKsPmx5PgzaeLc66gPuDQZoVwJ5gYtauMa63Q=; b=fifc/ZbR9urTH0Du/798Zj6cSa7ltkAJelibRLdZzW4q6zIms7TOdWtLxijGIAHBiH yg/FWaU3EOuDRoEEZBz3m2+BzVetJMBfXLtQlRxj1sMY+Ul+yC7PkjxkQG6JaH+VgXiC 32PL7e7w758ymnfXOeqFd4O7SoxfTTYvMwUs4E8NRat6JYnRmWgqvc/sF5KhaWHoM2+S gqhbFKVZLItXYmh0+VH1Jo3c6jbpdZNVg2f/VZ/uHJFqd7uPInBN3kYlZApFRq9n8nJK GJBeMNK7mZvbEZX2xvXIIK3BumCSZoktWv+OubOZXFnYuZpmCK6mOPx90jCTRvrs1NSs 3e0g== X-Gm-Message-State: ALyK8tLW3cgRYR7pE5fKtHn16h+j71Zdfse4Td9vbJCjpdOaTv50DjV8zHUqNCYJ1IAJHg== X-Received: by 10.98.52.3 with SMTP id b3mr77359pfa.40.1468385118710; Tue, 12 Jul 2016 21:45:18 -0700 (PDT) Original-Received: from calancha-pc ([240f:6e:c00e:1:6875:2e94:598b:96cb]) by smtp.gmail.com with ESMTPSA id d3sm3048396pfk.37.2016.07.12.21.45.16 for <23959@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jul 2016 21:45:18 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc User-Agent: Alpine 2.20 (DEB 67 2015-01-07) 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: 208.118.235.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:120976 Archived-At: Thank you for the report. >I believe this is because the fish shell interprets the "{}" as a brace >expansion -- see >http://fishshell.com/docs/current/index.html#expand-brace -- and needs >the braces to be escaped. Editing the grep command using C-u and >inserting quotes around the braces makes it work as expected. Yes, braces should be escaped in commands to be processed by a shell. I am going to apply following patch to the master branch: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 2b44b58..f7f097b 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -543,7 +543,9 @@ grep-compute-defaults (let* ((host-id (intern (or (file-remote-p default-directory) "localhost"))) (host-defaults (assq host-id grep-host-defaults-alist)) - (defaults (assq nil grep-host-defaults-alist))) + (defaults (assq nil grep-host-defaults-alist)) + (quot-braces (shell-quote-argument "{}")) + (quot-scolon (shell-quote-argument ";"))) ;; There are different defaults on different hosts. They must be ;; computed for every host once. (dolist (setting '(grep-command grep-template @@ -637,9 +639,8 @@ grep-compute-defaults ""))) (cons (if (eq grep-find-use-xargs 'exec-plus) - (format "%s %s{} +" cmd0 null) - (format "%s {} %s%s" cmd0 null - (shell-quote-argument ";"))) + (format "%s %s%s +" cmd0 null quot-braces) + (format "%s %s %s%s" cmd0 quot-braces null quot-scolon)) (1+ (length cmd0))))) (t (format "%s . -type f -print | \"%s\" %s" @@ -655,12 +656,11 @@ grep-compute-defaults (format "%s -type f -print0 | \"%s\" -0 %s" find-program xargs-program gcmd)) ((eq grep-find-use-xargs 'exec) - (format "%s -type f -exec %s {} %s%s" - find-program gcmd null - (shell-quote-argument ";"))) + (format "%s -type f -exec %s %s %s%s" + find-program gcmd quot-braces null quot-scolon)) ((eq grep-find-use-xargs 'exec-plus) - (format "%s -type f -exec %s %s{} +" - find-program gcmd null)) + (format "%s -type f -exec %s %s%s +" + find-program gcmd null quot-braces)) (t (format "%s -type f -print | \"%s\" %s" find-program xargs-program gcmd)))))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6) of 2016-07-13 Repository revision: 54b7eb0dee2397f1430e81b7356f8efb19946ba0