all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: John Mastro <john.b.mastro@gmail.com>
To: 23590@debbugs.gnu.org
Cc: Alex <agrambot@gmail.com>
Subject: bug#23590: 25.0.94; Errors in default lgrep command
Date: Sat, 23 Jul 2016 09:57:02 -0700	[thread overview]
Message-ID: <CAOj2CQR2AdfwDqMQT6vNTpqJ7L41mZkGwo7JR5Y=SszZjQ82MQ@mail.gmail.com> (raw)
In-Reply-To: <83fur0x0ft.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> wrote:
> Shell commands that Emacs emits support /bin/sh and compatible
> shells.  Zsh's default treatment of unmatched wildcards isn't.
>
> I don't know how it happened that lgrep invokes zsh on OP's system,
> but if that is due to user customizations, they should be corrected.
> If that is Emacs's fault (i.e. Emacs invokes zsh without any
> customizations), it should be fixed.

Emacs invokes whichever shell is the value of the user's SHELL
environment variable.

My reading of the code is that this is the result of a call chain from
`lgrep', to `compilation-start', to `start-file-process-shell-command',
to `start-file-process'. The only way `shell-file-name' is disregarded
in favor of /bin/sh is if `default-directory' is remote:

(defun start-file-process-shell-command (name buffer &rest args)
  (start-file-process
   ...
   (if (file-remote-p default-directory) "/bin/sh" shell-file-name)
   ...))

And shell-file-name is initialized to the value of SHELL in
init_callproc():

char *sh;
...
sh = getenv ("SHELL");
Vshell_file_name = build_string (sh ? sh : "/bin/sh");

So the user may not have intended to customize Emacs per se, but setting
SHELL does so indirectly.

This is my first time looking at most of this code but, if the intent is
for `lgrep' to always use /bin/sh, the least ugly way I see of doing
that is to let-bind `shell-file-name' in `lgrep'.

Obviously it would remain the case that Emacs uses shell-file-name for
other commands, but since AFAIK that hasn't been a problem more
generally a minimal change may be best.

> Yes, but I don't understand why the OP says these are errors.  They
> aren't; they are just informative messages from Grep.

I'm guessing this was just a misunderstanding about how `lgrep' works.
If the reporter thought of it as "call grep on all files", and didn't
think of directories as files, then it might be surprising at first to
see those messages.

        John





  reply	other threads:[~2016-07-23 16:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-21  0:11 bug#23590: 25.0.94; Errors in default lgrep command Alex
2016-07-23  2:16 ` John Mastro
2016-07-23  7:45   ` Eli Zaretskii
2016-07-23 16:57     ` John Mastro [this message]
2016-07-23 17:15       ` Eli Zaretskii
2016-07-23 17:23         ` John Mastro
2016-07-23 17:58           ` Eli Zaretskii
2016-07-23 19:52             ` Glenn Morris
2016-07-23 17:28     ` Alex
2016-07-23 18:00       ` Eli Zaretskii
2016-07-23 18:18         ` Eli Zaretskii
2016-07-23 22:12           ` Alex
2020-09-04 14:09             ` Lars Ingebrigtsen
2020-10-07  3:41               ` Lars Ingebrigtsen
2020-10-07  8:17                 ` Eli Zaretskii
2020-10-09  4:15                   ` Lars Ingebrigtsen
2020-10-13 20:09                     ` Juri Linkov
2020-10-14  4:10                       ` Lars Ingebrigtsen
2016-07-23 17:11   ` Alex

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='CAOj2CQR2AdfwDqMQT6vNTpqJ7L41mZkGwo7JR5Y=SszZjQ82MQ@mail.gmail.com' \
    --to=john.b.mastro@gmail.com \
    --cc=23590@debbugs.gnu.org \
    --cc=agrambot@gmail.com \
    /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.