all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Schroeder via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: dmitry@gutov.dev, 66338@debbugs.gnu.org
Subject: bug#66338: 30.0.50; grep-commnd set and using an old fish results in empty Copyright files
Date: Wed, 04 Oct 2023 20:47:35 +0200	[thread overview]
Message-ID: <871qeajkc8.fsf@alexschroeder.ch> (raw)
In-Reply-To: <83a5sy5o01.fsf@gnu.org> (message from Eli Zaretskii on Wed, 04 Oct 2023 19:52:14 +0300)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Dmitry Gutov <dmitry@gutov.dev>
>> 
>> 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 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.

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?

Cheers
Alex





  reply	other threads:[~2023-10-04 18:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04 10:09 bug#66338: 30.0.50; grep-commnd set and using an old fish results in empty Copyright files Alex Schroeder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-04 13:06 ` Dmitry Gutov
2023-10-04 16:52   ` Eli Zaretskii
2023-10-04 18:47     ` Alex Schroeder via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-10-05  5:22       ` Eli Zaretskii
2023-10-05  7:13         ` Alex Schroeder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-05 10:27           ` Michael Albinus
2023-10-05 10:43             ` Alex Schroeder via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-05  7:18         ` Alex Schroeder via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qeajkc8.fsf@alexschroeder.ch \
    --to=bug-gnu-emacs@gnu.org \
    --cc=66338@debbugs.gnu.org \
    --cc=alex@alexschroeder.ch \
    --cc=dmitry@gutov.dev \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.