From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Newsgroups: gmane.emacs.bugs Subject: bug#36558: When the user forgets the filename when using M-x grep Date: Tue, 09 Jul 2019 08:04:02 +0800 Message-ID: <87lfx8f4zx.5.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="220087"; mail-complaints-to="usenet@blaine.gmane.org" To: 36558@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 09 02:42:34 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkeDJ-000v8v-IZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jul 2019 02:42:34 +0200 Original-Received: from localhost ([::1]:45858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkeDH-0001bg-BI for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Jul 2019 20:42:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50438) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkeCs-0001bY-JK for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:42:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkeCr-0003Wj-JL for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:42:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hkeCq-0003Vk-Mr for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:42:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hkeCq-0001D2-HD for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:42:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Jul 2019 00:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36558 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15626328954612 (code B ref -1); Tue, 09 Jul 2019 00:42:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jul 2019 00:41:35 +0000 Original-Received: from localhost ([127.0.0.1]:60029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkeCM-0001CK-PD for submit@debbugs.gnu.org; Mon, 08 Jul 2019 20:41:35 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:59817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hkeCL-0001CD-G9 for submit@debbugs.gnu.org; Mon, 08 Jul 2019 20:41:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50351) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkeCK-0001b6-HZ for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:41:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkeCJ-0002sY-KM for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:41:32 -0400 Original-Received: from aye.elm.relay.mailchannels.net ([23.83.212.6]:23504) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hkeCJ-0002qL-6k for bug-gnu-emacs@gnu.org; Mon, 08 Jul 2019 20:41:31 -0400 X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E589E8C118D for ; Tue, 9 Jul 2019 00:41:28 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a63.g.dreamhost.com (100-96-23-68.trex.outbound.svc.cluster.local [100.96.23.68]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 797798C159A for ; Tue, 9 Jul 2019 00:41:28 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Original-Received: from pdx1-sub0-mail-a63.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.3); Tue, 09 Jul 2019 00:41:28 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@jidanni.org X-MailChannels-Auth-Id: dreamhost X-Stretch-Grain: 65920a507d059c0c_1562632888747_2292132755 X-MC-Loop-Signature: 1562632888747:3148430821 X-MC-Ingress-Time: 1562632888747 Original-Received: from pdx1-sub0-mail-a63.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a63.g.dreamhost.com (Postfix) with ESMTP id 40F198325E for ; Mon, 8 Jul 2019 17:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type; s= jidanni.org; bh=nQeswFuUjeRgOrOFR3SG1yEYdeY=; b=HX5yTItHc+bdXJj2 qv1gEQ770M/5+BxTxzXVAEGwX86sdQL9kFHt5TKrVfcx9aNTN+iOMSV39KKiRACL /0OD+zklXcW3AWvGDvrfbhq1UyYRMkt2+lHBGLafZf+06vOWjRWxS12E1lHCSx8T 0Rn3LTGQ5lFpxrXPhRPMLF6H7K4= Original-Received: from jidanni.org (111-246-86-9.dynamic-ip.hinet.net [111.246.86.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by pdx1-sub0-mail-a63.g.dreamhost.com (Postfix) with ESMTPSA id 8B54C8325D for ; Mon, 8 Jul 2019 17:41:25 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a63 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddrgedugdefjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesthdtredttddtjeenucfhrhhomhepnjjnnjcuffgrnhculfgrtghosghsohhnuceojhhiuggrnhhnihesjhhiuggrnhhnihdrohhrgheqnecukfhppeduuddurddvgeeirdekiedrleenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepjhhiuggrnhhnihdrohhrghdpihhnvghtpeduuddurddvgeeirdekiedrledprhgvthhurhhnqdhprghthheppeeruhhtfhdqkeerueerheeimhfphefnihehhegsveekreepucffrghnucflrggtohgsshhonhcuoehjihgurghnnhhisehjihgurghnnhhirdhorhhgqedpmhgrihhlfhhrohhmpehjihgurghnnhhisehjihgurghnnhhirdhorhhgpdhnrhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 209.51.188.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:162414 Archived-At: I don't think the M-x grep command has the ability for the user to change the default prompt from the current Run grep (like this): grep --color -nH --null -e to the rather more sophisticated Run grep (like this): grep --color -nH --null -e [] * where "[]" represents where the cursor should be placed when prompting the user. Mentioning how to do so in (info "(emacs) Grep Searching") or indeed, simply making it the new default, would save the 98% mistake rate of users forgetting to add a filename and think there was no matches (as outside of emacs this would hang without a filename, alerting the user to the problem.) Also M-x grep should detect that something tried to read stdin, meaning the user forgot the filename, and then warn the user, instead of just saying "No matches". Currently this is a very high possibility the user will just do Run grep (like this): grep --color -nH --null -e STRING and forget FILENAMEs creating an impossible situation, for which emacs currently just treats as if the user did Run grep (like this): grep --color -nH --null -e STRING /dev/null which helps nobody. At least emacs should catch this situation.