From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Mastro Newsgroups: gmane.emacs.bugs Subject: bug#23590: 25.0.94; Errors in default lgrep command Date: Sat, 23 Jul 2016 09:57:02 -0700 Message-ID: References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1469293103 23767 80.91.229.3 (23 Jul 2016 16:58:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2016 16:58:23 +0000 (UTC) Cc: Alex To: 23590@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 23 18:58:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bR0Fi-0005gX-5d for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 18:58:14 +0200 Original-Received: from localhost ([::1]:53038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR0Fh-0002Oy-4q for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 12:58:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR0Fa-0002Lz-6p for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 12:58:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR0FW-0000tH-1N for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 12:58:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50976) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR0FV-0000tD-VD for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 12:58:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bR0FV-0003lv-L7 for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2016 12:58:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Mastro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2016 16:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23590 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23590-submit@debbugs.gnu.org id=B23590.146929304914457 (code B ref 23590); Sat, 23 Jul 2016 16:58:01 +0000 Original-Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 16:57:29 +0000 Original-Received: from localhost ([127.0.0.1]:35080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0Ez-0003l6-2F for submit@debbugs.gnu.org; Sat, 23 Jul 2016 12:57:29 -0400 Original-Received: from mail-qt0-f176.google.com ([209.85.216.176]:34116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0Ex-0003ku-5Z for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 12:57:27 -0400 Original-Received: by mail-qt0-f176.google.com with SMTP id u25so77414215qtb.1 for <23590@debbugs.gnu.org>; Sat, 23 Jul 2016 09:57:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=FL7GbsQeUcVeJBI0uVu/UcEGBcOKp4KDQ7oZwgwugvc=; b=A/tMPhusipKfT7ZUxxysz6T+8NIaqVUOuXq0SIp9nSaYGgkXBlSahj6gudHALZ1bK8 1v5nVOdztnn+j2sO8bmByhfyEmylbVkzo6rQZaHjVrc7UWe/6JNIpORhrx0G7SxY0qk1 v32F1O+k8+nLDMZtuuemPIbii9WiK8oMBrRic9B8Yxhs6kFrfMw8qZzfDA65xoc3seIH 0bu4DWwxsW0diJHI7vk/e3GB7thnBRFN7oCHv9tjDxt5kDJBS0vbNyvwIVjGjd8PyKuY aGEd/uFZXiumy39QXMPIkdua5/LRgpJXSKboPKU6ZNPx/frgQHiVGRD2sVTZUhbHZfUg RBYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=FL7GbsQeUcVeJBI0uVu/UcEGBcOKp4KDQ7oZwgwugvc=; b=XdrIqpxP1ujFmAaHo/y4zGfqLAV5Da8Y+LPHlDu8D+nnGbcMobLUcrGcZG5mLrJMry lsahjAadm5IKbk0Js2JJdWtCVmff7uvDuoL+abY1QmGJHcT7ib4LmJlMMJG4mNqUG01e Dst3YB/RYxKmshcETGDyeLhwlW10Er55JCEZ+5OOEi3GclYB1YlglcjYfNMkdmykl0Q0 3ONOhI9Z50LO0q0Ku7qYBonSgXIMyYrOjQfTR9YC8K1/u8XYTNea2iMfDt4cYjEI2ISp sQ2TK+8IcoXxNTATN1GcGeHjsdIItl/uCKAytqyHkfetC/Thw1flwEhOSsYmRNa4uiIW I2Og== X-Gm-Message-State: AEkoous0dr3ojVqS7cjj/0i2BjnEzgT/6DNbZ04ypmcE+f5CDnLUMF55oxUoMmm2IHtb/iC16pd6A88mrgmzHg== X-Received: by 10.200.53.24 with SMTP id y24mr16036281qtb.16.1469293041685; Sat, 23 Jul 2016 09:57:21 -0700 (PDT) Original-Received: by 10.237.33.46 with HTTP; Sat, 23 Jul 2016 09:57:02 -0700 (PDT) In-Reply-To: <83fur0x0ft.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121455 Archived-At: Eli Zaretskii 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