From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How best to set grep command based on current directory? Date: Sat, 09 Apr 2022 09:10:32 +0300 Message-ID: <83a6cuaisn.fsf@gnu.org> References: <87a6cvkqo4.fsf@md5i.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36288"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Michael Welsh Duggan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 09 08:13:09 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nd4LN-0009Gt-Ku for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Apr 2022 08:13:09 +0200 Original-Received: from localhost ([::1]:55726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nd4LM-0002mB-Bn for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Apr 2022 02:13:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nd4Ie-0001tI-II for emacs-devel@gnu.org; Sat, 09 Apr 2022 02:10:20 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:39956) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nd4Ie-0003g9-7W; Sat, 09 Apr 2022 02:10:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=taOS9utVkLVsyKGl9ub7dsq+AOq3tW1MMOVogiI7Gi4=; b=AqSAFd6TtjP0 TUSDEqfwYJZ9VbscGz435aaBYjpuwut6LNXkx/cHfCGuZted3XYVXnKJSg+1nYgjW7cvh7CPmlgdi CrNq9kj2wIvFYKOax4Otvml9E3bA1qF6HUnAulJcmXxLOgX6tjdJCIpQdKCF+MIP3o6aGHgV7OslQ FkRl/325Vwzte8Sp0y5MJK0iO/H/vppKePeVlm6J0dhdizpoFr8jp1uCnk4hqCCeDu+FXtt14Biif gcmkP6LpaOa4lgUGEybITown2IQS6jwBVPz6O12cZELVtRHgFTiZPzIKlI7qttfm0lWhUCNfLbtKl htPBjtq47x7Pw77hdPed+g==; Original-Received: from [87.69.77.57] (port=1863 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nd4Id-0007UI-LN; Sat, 09 Apr 2022 02:10:20 -0400 In-Reply-To: <87a6cvkqo4.fsf@md5i.com> (message from Michael Welsh Duggan on Fri, 08 Apr 2022 21:10:19 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:287995 Archived-At: > From: Michael Welsh Duggan > Date: Fri, 08 Apr 2022 21:10:19 -0400 > > I would like to change the program invocation in "M-x grep" (or maybe > "M-x grep-find") to default to "git grep" when in directories that are > in git trees. I could hack away at the grep.el sources to do this, or I > could write some advice around the grep command to do this, but I want > to ask here, first, if anyone believes that there is a more principled > way to make this change. That must be an opt-in behavior, to avoid surprising the users. "M-x grep" is a very old command, so I don't think we can change its behavior in such radical ways unconditionally.