From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.devel Subject: How best to set grep command based on current directory? Date: Fri, 08 Apr 2022 21:10:19 -0400 Message-ID: <87a6cvkqo4.fsf@md5i.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15431"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Apr 09 03:11:55 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 1nczdr-0003nb-1i for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Apr 2022 03:11:55 +0200 Original-Received: from localhost ([::1]:41820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nczdp-0000E9-HO for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Apr 2022 21:11:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nczcN-0007pq-6B for emacs-devel@gnu.org; Fri, 08 Apr 2022 21:10:23 -0400 Original-Received: from md5i.com ([75.151.244.229]:47842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nczcL-0005LE-Fm for emacs-devel@gnu.org; Fri, 08 Apr 2022 21:10:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=brftQKbzCM4RsdfU8rqo7nKpg191GwSWkyq85v3RmsU=; b=VjVgu4WsXywXU9LDp0vJPDne4r EZz5HjZbsgdwMX09Kn4eokKuJNYYQZJkScKKePjd/t1OU4bV1JfS/93nSAu5krNfbUfNOXqy8Pvue lmxvmaRZfzYlh+x2xGzkN+PeZ; Original-Received: from abode ([192.168.177.1] helo=miko) by md5i.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1nczcK-00AeKR-0c for emacs-devel@gnu.org; Fri, 08 Apr 2022 21:10:20 -0400 Received-SPF: pass client-ip=75.151.244.229; envelope-from=mwd@md5i.com; helo=md5i.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:287987 Archived-At: 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. -- Michael Welsh Duggan (md5i@md5i.com)