From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#5360: 23.1.91; rgrep forces me to choose a directory Date: Tue, 01 Oct 2019 17:11:14 +0200 Message-ID: <87ftkc4i25.fsf@gnus.org> References: <87pr5gjgwf.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="226176"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 5360@debbugs.gnu.org To: jidanni@jidanni.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 01 17:12:16 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 1iFJp0-000wgz-I4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Oct 2019 17:12:14 +0200 Original-Received: from localhost ([::1]:43226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFJoz-0002vv-Bv for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Oct 2019 11:12:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44271) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFJor-0002vR-PW for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 11:12:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFJoq-0005VQ-FP for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 11:12:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53771) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFJoq-0005VC-Cb for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 11:12:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFJoo-0003k9-9G for bug-gnu-emacs@gnu.org; Tue, 01 Oct 2019 11:12:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Oct 2019 15:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5360 X-GNU-PR-Package: emacs Original-Received: via spool by 5360-submit@debbugs.gnu.org id=B5360.156994268214304 (code B ref 5360); Tue, 01 Oct 2019 15:12:02 +0000 Original-Received: (at 5360) by debbugs.gnu.org; 1 Oct 2019 15:11:22 +0000 Original-Received: from localhost ([127.0.0.1]:34350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFJoA-0003ie-Hx for submit@debbugs.gnu.org; Tue, 01 Oct 2019 11:11:22 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:53286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFJo8-0003iT-Im for 5360@debbugs.gnu.org; Tue, 01 Oct 2019 11:11:21 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iFJo3-0004RK-7C; Tue, 01 Oct 2019 17:11:17 +0200 In-Reply-To: <87pr5gjgwf.fsf@jidanni.org> (jidanni@jidanni.org's message of "Tue, 12 Jan 2010 08:39:12 +0800") 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:168021 Archived-At: jidanni@jidanni.org writes: > rgrep forces me to choose a directory, e.g., > (rgrep "INIT" "* .*" "/usr/share/initscripts/" nil) > when I really want to choose a wildcard of several directories. > > OK, so I use repeat-complex-command to forge in > (rgrep "INIT" "* .*" "/usr/share/init*" nil) > And low and behold, rgrep assumes it can cd to that "directory" and > proceeds even though the cd failed! So at least it should check that its > cd doesn't fail, even if wildcard directories will never be implemented. This seems to be on purpose: (unless (and dir (file-accessible-directory-p dir)) (setq dir default-directory)) If you name a directory and it doesn't exist, then default-directory is used, and it's done on purpose: commit 32a2cf25a74160b855041c176d2e7e937baa4de8 Author: Juri Linkov Date: Sat Aug 22 00:17:56 2009 +0000 (lgrep, rgrep): At the beginning set `dir' to `default-directory' unless `dir' is a non-nil readable directory. (Bug#4052) (lgrep, rgrep): Change a weird way to report an error from using `read-string' to using `error'. Instead of using interactive arguments in the function body, add new argument `confirm'. So I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no