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.bugs Subject: bug#66338: 30.0.50; grep-commnd set and using an old fish results in empty Copyright files Date: Thu, 05 Oct 2023 08:22:41 +0300 Message-ID: <83zg0x4p9a.fsf@gnu.org> References: <871qeajkc8.fsf@alexschroeder.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31515"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 66338@debbugs.gnu.org To: Alex Schroeder Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 05 07:24:14 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qoGqL-0007wb-Fe for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Oct 2023 07:24:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoGq0-0004gR-1E; Thu, 05 Oct 2023 01:23:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoGpx-0004g1-1T for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 01:23:49 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoGpr-00012m-LI for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 01:23:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoGq9-0001hh-Kf for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 01:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Oct 2023 05:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66338 X-GNU-PR-Package: emacs Original-Received: via spool by 66338-submit@debbugs.gnu.org id=B66338.16964833956453 (code B ref 66338); Thu, 05 Oct 2023 05:24:01 +0000 Original-Received: (at 66338) by debbugs.gnu.org; 5 Oct 2023 05:23:15 +0000 Original-Received: from localhost ([127.0.0.1]:45764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoGpO-0001g0-B7 for submit@debbugs.gnu.org; Thu, 05 Oct 2023 01:23:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoGp8-0001f8-MJ for 66338@debbugs.gnu.org; Thu, 05 Oct 2023 01:23:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoGok-0000tq-Bh; Thu, 05 Oct 2023 01:22:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=rXG/G8qfag92KLxnn/67gQROS547RGQrZULNqcwFgmE=; b=j6ZArztVNCPIF3qGjDCe Q/1YzbxIQxK88ib+CsedFtv+edtPsV4brOI8xjei/Z4lttF0sY4eUrLpHWO6WmFj5zUKVL8/Z5DKp HGfnANp3KkyvFYl3rhnrRmwHyVldKzF16L982uqpEhIKiuJ/OaFjFpVSL3T/QorCrMG6ltaesFFTx dVXbkXl9gqc0MJrKI2cPqyrur0TYWdavGIcwm51SD/JMKox0CxUxdR/yTxfRYQxGqwxzgtLX8HYnX HnxmYr5jJ8tQhJT4Mpc9C07vk9uQwE9W7KFZ6y6wmlwuw2+4NIXorY+dQx/bXmOUio9F15Zln3TMl 6PxURfO2uo+eWw==; In-Reply-To: <871qeajkc8.fsf@alexschroeder.ch> (message from Alex Schroeder on Wed, 04 Oct 2023 20:47:35 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271836 Archived-At: > From: Alex Schroeder > Cc: dmitry@gutov.dev, 66338@debbugs.gnu.org > Date: Wed, 04 Oct 2023 20:47:35 +0200 > > Eli Zaretskii writes: > > >> From: Dmitry Gutov > >> > >> Perhaps the problem is that you changed shell-file-name to point to > >> fish? > > > > Exactly. And that is never a good idea, because we use the semantics > > of Bourne shell in these cases. > > Well, it is set, but not by me. I checked using the following: > > find ~/.emacs.d -name '*.el' -exec grep -H shell-file-name '{}' ';' > > There are a few matches in magit, and a single match in my init.el file > where it is part of a huge custom-set-variables → > connection-local-profile-alist → > tramp-connection-local-default-shell-profile → shell-file-name → > "/bin/sh". So I don’t set it to "/usr/bin/fish" myself. > > When I start emacs -Q from my terminal emulator, I get an Emacs that has > shell-file-name set to "/usr/bin/fish". > The doc string says that shell-file-name is based on the SHELL > environment variable. That variable is of course set to /usr/bin/fish. It should be only set in interactive sessions. Please review your system init files, and modify them so that you override the default value of SHELL only in interactive sessions. > It seems to me that if it so important that Bourne shell semantics be > used, either shell-file-name should not be set automatically, or it > should be temporarily overridden in the cases where we rely on Bourne > shell semantics, or a warning should be printed whenever such code sees > a shell name it doesn’t know to be compatible with (although the > required fixes by a user like me would seem to be many and confusing). > > >From my point of view, it seems that manually setting shell-file-name to > "/bin/sh" is the only realistic solution and therefore I’d say that > setting this variable from the SHELL environment variable seems like the > wrong thing to do for Emacs. Is there a scenario where this is a good > idea? > > For interactive use like M-x shell we already use > explicit-shell-file-name which is based on ESHELL or shell-file-name. > Perhaps that variable should be based on ESHELL, SHELL, and only use > shell-file-name as a last resort and we no longer set shell-file-name > based on the SHELL variable. The Emacs manual says: ‘SHELL’ The name of an interpreter used to parse and execute programs run from inside Emacs. This is used to initialize the variable ‘shell-file-name’ (*note Single Shell::). So Emacs expects this variable to point to a shell that Emacs can use to run programs, not your interactive shell. If you want a different shell to be used in interactive shell sessions, such as "M-x shell", then you should use the variable explicit-shell-file-name to point to that other shell (in your case, fish). > Instead, shell-file-name should be set based on a list of known, > compatible shells available, or remain unset and all commands that rely > on it should fail gracefully and inform the user if no compatible shell > was found. > > What do you think? I think we already have the facilities to configure this as needed, see above.