From unknown Fri Sep 05 11:02:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#23590 <23590@debbugs.gnu.org> To: bug#23590 <23590@debbugs.gnu.org> Subject: Status: 25.0.94; Errors in default lgrep command Reply-To: bug#23590 <23590@debbugs.gnu.org> Date: Fri, 05 Sep 2025 18:02:01 +0000 retitle 23590 25.0.94; Errors in default lgrep command reassign 23590 emacs submitter 23590 Alex severity 23590 normal tag 23590 fixed patch thanks From debbugs-submit-bounces@debbugs.gnu.org Fri May 20 20:11:41 2016 Received: (at submit) by debbugs.gnu.org; 21 May 2016 00:11:41 +0000 Received: from localhost ([127.0.0.1]:59409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b3uW4-0007BS-Rm for submit@debbugs.gnu.org; Fri, 20 May 2016 20:11:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b3uW3-0007BF-In for submit@debbugs.gnu.org; Fri, 20 May 2016 20:11:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3uVx-0001xP-7x for submit@debbugs.gnu.org; Fri, 20 May 2016 20:11:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3uVx-0001xD-4T for submit@debbugs.gnu.org; Fri, 20 May 2016 20:11:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3uVu-0005Dh-Po for bug-gnu-emacs@gnu.org; Fri, 20 May 2016 20:11:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3uVq-0001wT-Gt for bug-gnu-emacs@gnu.org; Fri, 20 May 2016 20:11:29 -0400 Received: from mail-io0-x244.google.com ([2607:f8b0:4001:c06::244]:35425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3uVq-0001wP-By for bug-gnu-emacs@gnu.org; Fri, 20 May 2016 20:11:26 -0400 Received: by mail-io0-x244.google.com with SMTP id 190so6286858iow.2 for ; Fri, 20 May 2016 17:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:user-agent:date:message-id:mime-version; bh=dO+hH/4zAo5kTEXVTB0R1+sGDzaf7Tqqe4tSZ4QsjRk=; b=EKGlvvdDbCemPiaawQgpeE2uVbT7GPj5MUegTr3nXBGKwPqVMVe9xfvr8e6z1bS0vo crj9MO4miwouOdx8uyFOglQgXM8/OgcucltXYFQc9ErCWAicA2V72lCgiWp0GesfycQs VbJZUpoem9eiswOTYurlb/J7SJ/6aUTtNKvioQf8z0m+Lls5IfE8piEfxzR+lpTYMjov xewvrTe/LRrjdQCYI+Fky6KJraXpE4wKGueMHkefFArAOfqYEoj+ixODWVQkybdN08U6 8444RofifNsd+VstefOymG+y0hjacWIsTeimEeFmmM7A/ely1oF//SXDEagZ/wZ0kfw4 6HYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:user-agent:date:message-id :mime-version; bh=dO+hH/4zAo5kTEXVTB0R1+sGDzaf7Tqqe4tSZ4QsjRk=; b=afnRoQCtkn0PlbP5YWCgXyVyVCZjb60kqrc6youwXl9a1gMkydy2pji2OeejzuYzJx iQKUAOmRE9WtiUDrf+yjOmBQbliIFDCy0dpvaUJ0A+AZM7j8mbarZdzNKQjx32jjbLtB XvsN6dl/EHIZppgm22CEhs6lqKIp1ztHdRywbDI2yppRMKckETDUcjgogGaHhWJAdrt9 tT9aGQpAqZL2wI4e4K29gSbYcIeq5UbB+UHrYskIdQzAG1WlgmKOyC1g9xntPthaV8eF Ns9n/rpiBoZ/C8hgo6zLKh1avill/WSrtohsJt0huBiWA+SY9UfIs60+1Zhpyb7rN1mB Ve5w== X-Gm-Message-State: AOPr4FXyCOlCcXqpjGSrCf07YDKp3vptyRSaZu9W2hD8+5t4S2F4G7gpbCExkIXFsrlnfg== X-Received: by 10.107.35.131 with SMTP id j125mr4511689ioj.24.1463789485811; Fri, 20 May 2016 17:11:25 -0700 (PDT) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id h67sm6686230iof.28.2016.05.20.17.11.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 May 2016 17:11:25 -0700 (PDT) From: Alex To: bug-gnu-emacs@gnu.org Subject: 25.0.94; Errors in default lgrep command User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Date: Fri, 20 May 2016 18:11:18 -0600 Message-ID: <87futcp8wp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) The default lgrep command (`all' for the FILES argument) gives off unexpected errors. * When there are no hidden (dot) files in the given directory, then I get the following error: zsh:1: no matches found: *. Grep exited abnormally with code 1 at ... By default lgrep uses my default shell (zsh). Should this be the case? Setting `shell-file-name' to "bash" fixes this error, but it still produces the next error. * When there are directories in the given directory (this includes . and ..) then lgrep produces an error for each directory. For example: grep: .: Is a directory grep: ..: Is a directory grep: .emacs.d: Is a directory Grep exited abnormally with code 2 at ... In GNU Emacs 25.0.94.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) of 2016-05-17 built on lylat Windowing system distributor 'Fedora Project', version 11.0.11803000 Configured using: 'configure --with-gif=no' Configured features: XPM JPEG TIFF PNG SOUND DBUS GSETTINGS NOTIFY FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LC_CTYPE: en_CA.utf8 value of $LANG: en_CA.utf8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils thingatpt grep compile comint ansi-color ring time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 95915 8690) (symbols 48 20220 0) (miscs 40 50 221) (strings 32 16338 4494) (string-bytes 1 485576) (vectors 16 12554) (vector-slots 8 436687 5729) (floats 8 172 70) (intervals 56 346 19) (buffers 976 12) (heap 1024 43598 1075)) From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 22:16:56 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 02:16:56 +0000 Received: from localhost ([127.0.0.1]:34113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQmUq-0006x3-9u for submit@debbugs.gnu.org; Fri, 22 Jul 2016 22:16:56 -0400 Received: from mail-qk0-f178.google.com ([209.85.220.178]:34198) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQmUm-0006wo-SK for 23590@debbugs.gnu.org; Fri, 22 Jul 2016 22:16:54 -0400 Received: by mail-qk0-f178.google.com with SMTP id o67so116318782qke.1 for <23590@debbugs.gnu.org>; Fri, 22 Jul 2016 19:16:52 -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=0utgQhM84b3a+zOeeQ+o8+qE6zvzicDC+y8e9blplMI=; b=vKZPx/T/XtgV/59n75L65mJpy1CQKIUbzNHNJGBH2uDyH6Kju6myh24krGk0nioUjs w5QWR4/8zB4sBzeSrFq7UE9YFOUdodi5zdv//k6w2QgpgCS8rq9ZoENAvXwSLzCEfvMb nIhxj2d1Gc0ptTT45r1xxrY7pq0xkHnsqVs3s2nUu00/hK8gxbl+bc3jUnN19P/6nT1U DuLpQfVsEiQCR+uERCcrHoCKJpLrIRLmLGIQFJMAJ2KxkPUDzA0g/cEEZg/CJ4T75h89 6cr0Q5fnCqbdQtxmTAqmCh0oqowSGWU02d9vWToY8hDryoHgTADTEXW47+EnoH4uIDQQ WklA== 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=0utgQhM84b3a+zOeeQ+o8+qE6zvzicDC+y8e9blplMI=; b=gLhqTfZFwW1JNXJBH3UlnWC5u8fAC13cx7l01ahNM6kNcDoNMdnobqTkIgNHPIPfGN i7EouSFIgJHwx7ZEvo/u1iQu/DAueCNDT/RV8Vho5dpBRDvN/PW5vurBJcsaqKta6tJa YGFGEeh2NgA/5S6aT0/Ll1SXoJs/050OJgqPAQVDI6fFZXRCZv5UXujKEkJpUFNHKobc jdMAgbkn36rrjMnJAadF2PsEda8vSMFDrACTNU/eEEXbwFyPeuf5bSJZh72j7bYqqxCd rK3Ok9Yu2jXxBxIexfoNsRURPBM+uR2g9XiHFjiCpaxUmQhvr5N/UV5MLHz2f2dZVQPX 6JuA== X-Gm-Message-State: AEkoouul6pykQEF7KHEarH4X6NBB86GUk4zj/Y76xnHLZxk6AuAvbtLmkNYmQ/E4HPEscYUfj2w8u/V8g3x1EQ== X-Received: by 10.55.108.2 with SMTP id h2mr8408792qkc.202.1469240207318; Fri, 22 Jul 2016 19:16:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.33.46 with HTTP; Fri, 22 Jul 2016 19:16:27 -0700 (PDT) In-Reply-To: <87futcp8wp.fsf@gmail.com> References: <87futcp8wp.fsf@gmail.com> From: John Mastro Date: Fri, 22 Jul 2016 19:16:27 -0700 Message-ID: Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command To: 23590@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23590 Cc: Alex X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Alex wrote: > The default lgrep command (`all' for the FILES argument) gives > off unexpected errors. > > * When there are no hidden (dot) files in the given directory, then I > get the following error: > > zsh:1: no matches found: *. > Grep exited abnormally with code 1 at ... > > By default lgrep uses my default shell (zsh). Should this be the case? > Setting `shell-file-name' to "bash" fixes this error, but it still > produces the next error. Thanks for reporting this. I've seen it too. The problem seems to be caused by a difference in how zsh handles globs that don't match anything, compared to bash. I'm not sure what the right way would be to accommodate it in Emacs. Hopefully someone will be along shortly with ideas for that. However, there are a couple things you can do to work around it in the meantime. First, you could change the command used by `lgrep' to enable zsh's NULL_GLOB option, of which the zsh documentation[1] says: "If a pattern for filename generation has no matches, delete the pattern from the argument list instead of reporting an error". To do that, you could use something like: (with-eval-after-load 'grep (grep-apply-setting 'grep-template "setopt null_glob; grep -n -e ")) Second, you could use advice on `lgrep' so that it invokes grep via bash rather than zsh. That would look like: (defun grep-use-bash (original &rest args) (let ((shell-file-name (executable-find "bash"))) (apply original args))) (with-eval-after-load 'grep (advice-add 'lgrep :around #'grep-use-bash)) I tested both options only briefly; apologies if I missed any issues. > * When there are directories in the given directory (this includes . and > ..) then lgrep produces an error for each directory. For example: > > > grep: .: Is a directory > grep: ..: Is a directory > grep: .emacs.d: Is a directory > > Grep exited abnormally with code 2 at ... GNU Grep has an option (-d ACTION or --directories=ACTION) that can be used to skip over directories (with "skip" as the ACTION), but it's not in POSIX so I doubt we can use it in Emacs. If you know it will be available on your system(s), you could add it to your `grep-template' using the same technique as above. [1] http://www.cs.elte.hu/zsh-manual/zsh_16.html John From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 03:45:12 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 07:45:13 +0000 Received: from localhost ([127.0.0.1]:34167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQrcW-0007yg-Dr for submit@debbugs.gnu.org; Sat, 23 Jul 2016 03:45:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQrcU-0007yT-Nq for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 03:45:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQrcO-000413-Hi for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 03:45:05 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQrcK-00040U-Qa; Sat, 23 Jul 2016 03:45:00 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2366 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bQrcJ-0006Ms-M4; Sat, 23 Jul 2016 03:45:00 -0400 Date: Sat, 23 Jul 2016 10:45:10 +0300 Message-Id: <83fur0x0ft.fsf@gnu.org> From: Eli Zaretskii To: John Mastro In-reply-to: (message from John Mastro on Fri, 22 Jul 2016 19:16:27 -0700) Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 23590 Cc: 23590@debbugs.gnu.org, agrambot@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: John Mastro > Date: Fri, 22 Jul 2016 19:16:27 -0700 > Cc: Alex > > Alex wrote: > > The default lgrep command (`all' for the FILES argument) gives > > off unexpected errors. > > > > * When there are no hidden (dot) files in the given directory, then I > > get the following error: > > > > zsh:1: no matches found: *. > > Grep exited abnormally with code 1 at ... > > > > By default lgrep uses my default shell (zsh). Should this be the case? > > Setting `shell-file-name' to "bash" fixes this error, but it still > > produces the next error. > > Thanks for reporting this. I've seen it too. > > The problem seems to be caused by a difference in how zsh handles globs > that don't match anything, compared to bash. I'm not sure what the right > way would be to accommodate it in Emacs. Hopefully someone will be along > shortly with ideas for that. 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. > > * When there are directories in the given directory (this includes . and > > ..) then lgrep produces an error for each directory. For example: > > > > > > grep: .: Is a directory > > grep: ..: Is a directory > > grep: .emacs.d: Is a directory > > > > Grep exited abnormally with code 2 at ... > > GNU Grep has an option (-d ACTION or --directories=ACTION) that can be > used to skip over directories (with "skip" as the ACTION), but it's not > in POSIX so I doubt we can use it in Emacs. If you know it will be > available on your system(s), you could add it to your `grep-template' > using the same technique as above. Yes, but I don't understand why the OP says these are errors. They aren't; they are just informative messages from Grep. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 12:57:29 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 16:57:29 +0000 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 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 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) MIME-Version: 1.0 Received: by 10.237.33.46 with HTTP; Sat, 23 Jul 2016 09:57:02 -0700 (PDT) In-Reply-To: <83fur0x0ft.fsf@gnu.org> References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> From: John Mastro Date: Sat, 23 Jul 2016 09:57:02 -0700 Message-ID: Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command To: 23590@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23590 Cc: Eli Zaretskii , Alex X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 13:11:46 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 17:11:46 +0000 Received: from localhost ([127.0.0.1]:35084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0So-000454-CH for submit@debbugs.gnu.org; Sat, 23 Jul 2016 13:11:46 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:34993) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0Sn-00044t-EN for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 13:11:45 -0400 Received: by mail-it0-f44.google.com with SMTP id u186so58469284ita.0 for <23590@debbugs.gnu.org>; Sat, 23 Jul 2016 10:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=/NtNV8dZy7iUSsj3/w8nJBpnqrWcKo08n8QU6Ma2AbY=; b=xBRiakkYO9fAP+cPwrJvKEIMLwKGbv+sE/8/grSd9mwc3HItekD+rkVct0pV/KrAIv xUfCHBkIsUGT9eE/+EADh66A7O5iQzN2iT7kMnnbqj3zNXA9X1EtRaE7ZGDNuwwz7l0M HtK0G5QaFIjdv6kYE1TGGn0SIAO4vzJYDsvo1gLF1oq/0Ikmzuc5cxvFuFlOVjyY6s50 U7uaL7Ebr56YhQ8bdtJ+Xkm6SQg9maOrM9CwqyhGsSWI/VAi/K0jTFbyIHjtSnoRIzcL opzwYBe2W7jt6Rj2Uy25+2/Jrg8cQRPvD8xJfv0Ug8foaanD/i7O5IidFZPSM783uf/t xNMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=/NtNV8dZy7iUSsj3/w8nJBpnqrWcKo08n8QU6Ma2AbY=; b=GcttBCynM6RkzeAfjLbgJVK+UNvHHhNdzy0g0zvwgLO2ijy7UleiwBayej8DUCkFy6 ycNidkzZ8SREAUw68OPagHrzC9Im0pz8S26EZ5Q9H+X45a6gOW2QOgl40dPMCF08fveQ GVp4w/Zn4lMis5KcixvdutJJz0wc9aLdiTQ8LMlgc2BjybARPcCqL/cNn4xGglEluK/E IMD5zQc6nnCRUwrxFtNsoUlYCH7yVkwETo7lWTvT3TqXoLLxq0Sm70kJkn39V7yHcYtO kAeoQOOXPoWwHGbQNOepDOuIxRsShrW4zd4LHO/IGiPhv9ei5EIZFOB5eREnniNQZca7 ArOw== X-Gm-Message-State: AEkooutqHAN4d5/oNgopUV/mFsSPk4gVdiOCv23skmWtSQOh31bmyxgS95nxUg4Wxzhlgw== X-Received: by 10.36.200.134 with SMTP id w128mr11729592itf.92.1469293899858; Sat, 23 Jul 2016 10:11:39 -0700 (PDT) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id l63sm7814422ioi.14.2016.07.23.10.11.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jul 2016 10:11:39 -0700 (PDT) From: Alex To: John Mastro Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command In-Reply-To: (John Mastro's message of "Fri, 22 Jul 2016 19:16:27 -0700") References: <87futcp8wp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) Date: Sat, 23 Jul 2016 11:11:36 -0600 Message-ID: <87h9bgcm9j.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23590 Cc: 23590@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) John Mastro writes: > (with-eval-after-load 'grep > (grep-apply-setting > 'grep-template > "setopt null_glob; grep -n -e ")) > GNU Grep has an option (-d ACTION or --directories=ACTION) that can be > used to skip over directories (with "skip" as the ACTION), but it's not > in POSIX so I doubt we can use it in Emacs. If you know it will be > available on your system(s), you could add it to your `grep-template' > using the same technique as above. Thanks, these workarounds work exactly as you said. It does seem that outside of setting null_glob somewhere, there isn't a way to get zsh to behave correctly. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 13:15:18 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 17:15:18 +0000 Received: from localhost ([127.0.0.1]:35089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0WD-0004Ac-QU for submit@debbugs.gnu.org; Sat, 23 Jul 2016 13:15:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0WD-0004AQ-1p for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 13:15:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR0W7-00048l-1M for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 13:15:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR0W3-00044c-F9; Sat, 23 Jul 2016 13:15:07 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2854 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bR0W1-0000OJ-G4; Sat, 23 Jul 2016 13:15:05 -0400 Date: Sat, 23 Jul 2016 20:15:14 +0300 Message-Id: <83h9bguvh9.fsf@gnu.org> From: Eli Zaretskii To: John Mastro In-reply-to: (message from John Mastro on Sat, 23 Jul 2016 09:57:02 -0700) Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 23590 Cc: 23590@debbugs.gnu.org, agrambot@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: John Mastro > Date: Sat, 23 Jul 2016 09:57:02 -0700 > Cc: Eli Zaretskii , Alex > > 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. Then maybe we should change that. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 13:23:47 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 17:23:47 +0000 Received: from localhost ([127.0.0.1]:35097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0eQ-0004Mm-U1 for submit@debbugs.gnu.org; Sat, 23 Jul 2016 13:23:47 -0400 Received: from mail-qt0-f175.google.com ([209.85.216.175]:36229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0eP-0004MZ-7Q for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 13:23:45 -0400 Received: by mail-qt0-f175.google.com with SMTP id 52so77639940qtq.3 for <23590@debbugs.gnu.org>; Sat, 23 Jul 2016 10:23:45 -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=fzMxsTGXHjwv10pP2jjo7U2gOLdvBp/xnzaJGPpuc8A=; b=tb3DZzLIjEjiozgFPw+OttMEmKGU+h2GrKKaAx3QelgXpM4pYZdh6QcbhbWP2QQeYe cOTB6ZxLxGgEuVMlQAJ2KK6n74UhoMbCurNmsXocxnMSzjj5LynS/Zx1U9RMqaFM+/nn T6iv06jG3+RpwgovJBlbgJW+F0k7ey9LO16v69cbrw9UEFuL7H+MT64TzqwExa60Wx6e QwHumxVj9F/0rTZ+9CTAr2VgKea79y6aR1yBMKOUVLtbqccK0jkJ2n9OyhCovyzrDwZe TSex3wt3O+voIlPXo9zmPJ9xjGHLHm3gB+QL1zJitHPKieFYaPKqDer/1rUPvYNwquYw ySnQ== 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=fzMxsTGXHjwv10pP2jjo7U2gOLdvBp/xnzaJGPpuc8A=; b=LiCUNKVoXOPCs//4MhoO87LTRqJSI3LmmITZIEgWvN6O1Bjw6FTWG4GdG1d4S8Suhy TgOPceCANvMxY0RFjb5LYVjo7Yq4IRiX6xy+6pk1j9RteqhLZ85iaFGPbeQm4qle6DNd fVxta7zVASyce5PtF7qYmO3srGgqeiyhTXGVgU4SX+Kp76iuH8JY3zt2xfWgKc6Sllt/ vktXLCYrlDn/mGvF/pzbfXA5OmQtcLHjoooiY2JkWe97RNKv9mRiuWbhF6kEgB5gwB1Q 7OT/yNkX/m1VAnzG8bDCFSkacQ6n5PQMCmnn0MkFIpo1WAU8YCgctQSpQWMnJ0Kqpk9b 2v+g== X-Gm-Message-State: AEkoout/wkC/iYXChqS2NRpbHQWcftoIzHKry6jqTWsRSXqz99s/O3VA/dcBpn5RSFhSSevOUIsEcaXX062d6g== X-Received: by 10.237.41.225 with SMTP id o88mr16853886qtd.18.1469294619864; Sat, 23 Jul 2016 10:23:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.33.46 with HTTP; Sat, 23 Jul 2016 10:23:20 -0700 (PDT) In-Reply-To: <83h9bguvh9.fsf@gnu.org> References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <83h9bguvh9.fsf@gnu.org> From: John Mastro Date: Sat, 23 Jul 2016 10:23:20 -0700 Message-ID: Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command To: 23590@debbugs.gnu.org Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23590 Cc: Eli Zaretskii , Alex X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii wrote: >> Emacs invokes whichever shell is the value of the user's SHELL >> environment variable. > > Then maybe we should change that. Do you mean for `lgrep' specifically or at a lower level? To be honest, I don't have a good enough feel for the implications to have a strong opinion. This is admittedly an anecdote but, having used zsh as my SHELL (and `shell-file-name') for several years, this scenario with `lgrep' and the "all" alias is the only time I've run into a problem. John From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 13:28:30 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 17:28:30 +0000 Received: from localhost ([127.0.0.1]:35101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0j0-0004TI-Fz for submit@debbugs.gnu.org; Sat, 23 Jul 2016 13:28:30 -0400 Received: from mail-io0-f172.google.com ([209.85.223.172]:35493) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR0iy-0004T5-SX for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 13:28:29 -0400 Received: by mail-io0-f172.google.com with SMTP id m101so130329300ioi.2 for <23590@debbugs.gnu.org>; Sat, 23 Jul 2016 10:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=I2O0QSfHcaJZ+CgVrgzDRTm/VQSAQw69ywrAK1VwnBA=; b=s0d7346ih+JJHM7IH5puyY0/vnMAPYlAt4lR1ZWCd2QMnP9d47snS88QmKelEcT763 Ovesqhcc6EexTCy4KSHY9yBQ2ls52NezQlfuTCmynp+C20MHj116Z5DJsmouPJ+QiIXT wItsdR3XIeZy15zGBf0UgyrsB+4fXm1OGUwtVacvE8Rtc1/Jnsf2pZOTm7smLYO5n+Qe rT7IumnXJEJyQVEccguZXzAliskHexu4RU/Pg/vkrZcKG84ysvrYYrgnlc2RVehttFBX CZSMiSAeRaZEG5VAt+kmIW+Djq7TNakTCJrYg494OWPjeFte/4se4fbu5MWArLzfi//7 F5Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=I2O0QSfHcaJZ+CgVrgzDRTm/VQSAQw69ywrAK1VwnBA=; b=cmI3Dvk+GVF0ZPgGEzjrclWJamPMm6t6bkwRPX8ZUERMlVsitJfJLizz2wriR8oCnS Kyfvp/wzPphUUdqVR8VjjCV5v+kvUeJoSXiPbQ+kmSpLvPukA0labXhd6g4hBLxBQeXu PqQxB8o2j34KDb0UYBvRi5xioR2vDIwhjy0qz6eBkKY6pzZ8RQ2hxcnz5Byrz8XuBMoi 3x2Tf9EITLq1I4GyG4G55FS/IpmFby3JW5M1bFVMJCI6btcBTpOjxLSUhc9pPe/0j0wK HoJhmqLGFfNvHILUUB5EkfOoe7B20p9LGZPaHI1KJn3ehDyD0WfQDYRS6ht98WKWg3wt wHnw== X-Gm-Message-State: AEkoouvhtBRJT5yRotiNZCHM53tCknqFxs01p+TcRc3/oxjowKW7148y3gk3FicSyJSMxw== X-Received: by 10.107.169.40 with SMTP id s40mr11599041ioe.19.1469294903209; Sat, 23 Jul 2016 10:28:23 -0700 (PDT) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id p63sm5555382itg.9.2016.07.23.10.28.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jul 2016 10:28:22 -0700 (PDT) From: Alex To: Eli Zaretskii Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> Date: Sat, 23 Jul 2016 11:28:21 -0600 In-Reply-To: <83fur0x0ft.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jul 2016 10:45:10 +0300") Message-ID: <87fur0clhm.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23590 Cc: John Mastro , 23590@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > 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. shell-file-name is set to zsh (as it's my default user shell) in emacs -Q as well. This can be useful for commands like ansi-term. If an Emacs program expects full sh compatibility, then perhaps there could be an extra variable they can check before falling back to shell-file-name? >> GNU Grep has an option (-d ACTION or --directories=ACTION) that can be >> used to skip over directories (with "skip" as the ACTION), but it's not >> in POSIX so I doubt we can use it in Emacs. If you know it will be >> available on your system(s), you could add it to your `grep-template' >> using the same technique as above. > > Yes, but I don't understand why the OP says these are errors. They > aren't; they are just informative messages from Grep. When I use lgrep I already know that I'm not going to be searching directories. I find such messages to be useless clutter. Additionally, while zsh doesn't error on this part (with the workarounds that John provided), bash does appear to error because it is including directories: Grep exited abnormally with code 2 at ... PS: I noticed that between 25.0.94 and 25.0.95 the default command changes slightly. It now includes a wildcard ..?* that bash doesn't seem to like if there are no matching files: grep: ..?*: No such file or directory Grep exited abnormally with code 2 at ... From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 13:58:19 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 17:58:19 +0000 Received: from localhost ([127.0.0.1]:35123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1Bq-0005AQ-Vk for submit@debbugs.gnu.org; Sat, 23 Jul 2016 13:58:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58086) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1Bp-0005AE-JG for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 13:58:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR1Bj-0002bj-Nt for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 13:58:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR1Bg-0002bX-3a; Sat, 23 Jul 2016 13:58:08 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2892 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bR1Bc-0002np-70; Sat, 23 Jul 2016 13:58:06 -0400 Date: Sat, 23 Jul 2016 20:58:03 +0300 Message-Id: <83bn1outhw.fsf@gnu.org> From: Eli Zaretskii To: John Mastro In-reply-to: (message from John Mastro on Sat, 23 Jul 2016 10:23:20 -0700) Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <83h9bguvh9.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 23590 Cc: 23590@debbugs.gnu.org, agrambot@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: John Mastro > Date: Sat, 23 Jul 2016 10:23:20 -0700 > Cc: Eli Zaretskii , Alex > > Eli Zaretskii wrote: > >> Emacs invokes whichever shell is the value of the user's SHELL > >> environment variable. > > > > Then maybe we should change that. > > Do you mean for `lgrep' specifically or at a lower level? No, I mean in general. > This is admittedly an anecdote but, having used zsh as my SHELL (and > `shell-file-name') for several years, this scenario with `lgrep' and the > "all" alias is the only time I've run into a problem. Why would you want to use zsh in commands issued by lgrep? From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 14:00:58 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 18:00:58 +0000 Received: from localhost ([127.0.0.1]:35127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1EL-0005FN-EA for submit@debbugs.gnu.org; Sat, 23 Jul 2016 14:00:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1EJ-0005FB-NZ for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 14:00:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR1EB-0003BQ-LI for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 14:00:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR1EB-0003BG-IC; Sat, 23 Jul 2016 14:00:43 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2893 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bR1E8-0006Pl-F2; Sat, 23 Jul 2016 14:00:43 -0400 Date: Sat, 23 Jul 2016 21:00:37 +0300 Message-Id: <83a8h8utdm.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <87fur0clhm.fsf@gmail.com> (message from Alex on Sat, 23 Jul 2016 11:28:21 -0600) Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <87fur0clhm.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 23590 Cc: john.b.mastro@gmail.com, 23590@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > From: Alex > Cc: John Mastro , 23590@debbugs.gnu.org > Date: Sat, 23 Jul 2016 11:28:21 -0600 > > > Yes, but I don't understand why the OP says these are errors. They > > aren't; they are just informative messages from Grep. > > When I use lgrep I already know that I'm not going to be searching > directories. I find such messages to be useless clutter. They cannot be avoided portably. Sorry. > Additionally, while zsh doesn't error on this part (with the workarounds > that John provided), bash does appear to error because it is including > directories: > > Grep exited abnormally with code 2 at ... Because of this: > grep: ..?*: No such file or directory From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 14:18:14 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 18:18:14 +0000 Received: from localhost ([127.0.0.1]:35136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1V8-0005eh-E5 for submit@debbugs.gnu.org; Sat, 23 Jul 2016 14:18:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60477) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR1V6-0005eU-SG for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 14:18:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR1Uw-0005lm-JO for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 14:18:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR1Uw-0005lb-GG; Sat, 23 Jul 2016 14:18:02 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2898 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bR1Ut-0000BF-To; Sat, 23 Jul 2016 14:18:00 -0400 Date: Sat, 23 Jul 2016 21:18:03 +0300 Message-Id: <838twsuskk.fsf@gnu.org> From: Eli Zaretskii To: Eli Zaretskii In-reply-to: <83a8h8utdm.fsf@gnu.org> (message from Eli Zaretskii on Sat, 23 Jul 2016 21:00:37 +0300) Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <87fur0clhm.fsf@gmail.com> <83a8h8utdm.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 23590 Cc: john.b.mastro@gmail.com, 23590@debbugs.gnu.org, agrambot@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) > Date: Sat, 23 Jul 2016 21:00:37 +0300 > From: Eli Zaretskii > Cc: john.b.mastro@gmail.com, 23590@debbugs.gnu.org > > > Grep exited abnormally with code 2 at ... > > Because of this: > > > grep: ..?*: No such file or directory Actually, I see that "Is a directory" also caused exit code of 2. So I guess patches are welcome to add --directory=skip to the Grep command when a preliminary test reveals that Grep supports it. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 15:53:05 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 19:53:05 +0000 Received: from localhost ([127.0.0.1]:35167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR2yv-0001CG-69 for submit@debbugs.gnu.org; Sat, 23 Jul 2016 15:53:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR2ys-0001Bk-SI for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 15:53:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bR2ym-0005lE-ST for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 15:52:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNRESOLVED_TEMPLATE autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR2yl-0005iX-H3; Sat, 23 Jul 2016 15:52:55 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1bR2yi-0006jJ-L4; Sat, 23 Jul 2016 15:52:52 -0400 From: Glenn Morris To: Eli Zaretskii Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <83h9bguvh9.fsf@gnu.org> <83bn1outhw.fsf@gnu.org> X-Spook: mailbomb Tamaulipas Gunfight NASA Secret Service Tamil X-Ran: x\$\x1UGan'wDU_y"4Sdsg(}~9Q;.*MMTd0[c]%-ZM1%TRwA~=}8EkQq's[KooP=rEAdxg X-Hue: blue X-Debbugs-No-Ack: yes X-Attribution: GM Date: Sat, 23 Jul 2016 15:52:52 -0400 In-Reply-To: <83bn1outhw.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jul 2016 20:58:03 +0300") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: 23590 Cc: John Mastro , 23590@debbugs.gnu.org, agrambot@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.6 (-----) Eli Zaretskii wrote: > Why would you want to use zsh in commands issued by lgrep? Not in the "commands issued by lgrep", but in the glob pattern passed to lgrep. One wants to use the same shell as one is used to using interactively, so that one can use that shell's glob patterns, if it has specific ones, as zsh does. (I'm not a zsh user.) I don't think forcing it to use bash is the right solution. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 23 18:13:18 2016 Received: (at 23590) by debbugs.gnu.org; 23 Jul 2016 22:13:18 +0000 Received: from localhost ([127.0.0.1]:35186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR5Ac-0004jl-Ec for submit@debbugs.gnu.org; Sat, 23 Jul 2016 18:13:18 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:33869) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bR5Ab-0004jZ-Fg for 23590@debbugs.gnu.org; Sat, 23 Jul 2016 18:13:17 -0400 Received: by mail-io0-f196.google.com with SMTP id g86so9647631ioj.1 for <23590@debbugs.gnu.org>; Sat, 23 Jul 2016 15:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ntTkKit9Xn4Uxrrx+d8j5bFXdtocJfpCBrdvvax//UQ=; b=zbU7U3XHEbpTkByoBramLwgA5053M6vdLPWEmi9ubptD4oh0QLcbGNXI5BxqG48kMQ uuIh7vqc56bZcZX+1TkoswVLfHOJproo4jSmcvrtSTNC5+H4FNB1u3FejZyNMRHBQIid vD35Hc5EZuYg8AcksIzsx/lxggvxldYv7myA6W5Qa7/lVKU6TF1jy0+daqaH7mRJKifz sh1jgnV2odIDc120xRkgyucJSkZNX5Z2ZwMmwRBPU1Ua0fe+TDwVLOk7eg0fq70Uw7dM pvhSPfqVC6zA9Yy7lHx2XUfkyx6W+qt3LdPuog7c1hYkBTsyjHgJEAZlCSDeNLh76G2l WOEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ntTkKit9Xn4Uxrrx+d8j5bFXdtocJfpCBrdvvax//UQ=; b=bHrD0OzB8fT5TlwdIUdsVXwa3eouklrpJLbwxor38DRph5UqbtCsvXnWucBOvBelIa QsLyXgtGzt0xe7qFHLCt7fCkP0GtHNaw8ypVJzFysFjTmm5uwgTDEqaqGwpehB37j8mJ XeSoag9nzwQYm9N7yhGXC2dZBvX0oD+o5fgUzOlB0txZPXRcHIc0fED61Maa0txk9KpV qfb1+iSm+CUO8gHOLnhJT05HSnFazyXyDF277HaTRwbEFz9VnNvsVMcZ/b0qZ2HE+SZV ImSjulsB7yMwtAy3vEgL8mO/9FiUBdxqqRlMkTB9gqGMtBQGWRr/zvNQolkKWIfr0ZWG tIMA== X-Gm-Message-State: AEkoouuys3OVSQClYiP/sKeDXNL3j1a7uffVuN3X+etYvdKSUjRlKhwxuTvoOueEjsSaWg== X-Received: by 10.107.15.218 with SMTP id 87mr14685363iop.0.1469311992007; Sat, 23 Jul 2016 15:13:12 -0700 (PDT) Received: from lylat (S01061859339e9903.ss.shawcable.net. [174.2.107.88]) by smtp.gmail.com with ESMTPSA id b66sm5700291itd.0.2016.07.23.15.13.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 23 Jul 2016 15:13:11 -0700 (PDT) From: Alex To: Eli Zaretskii Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <87fur0clhm.fsf@gmail.com> <83a8h8utdm.fsf@gnu.org> <838twsuskk.fsf@gnu.org> Date: Sat, 23 Jul 2016 16:12:55 -0600 In-Reply-To: <838twsuskk.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jul 2016 21:18:03 +0300") Message-ID: <87twfg0zrs.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 23590 Cc: john.b.mastro@gmail.com, 23590@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: >> Date: Sat, 23 Jul 2016 21:00:37 +0300 >> From: Eli Zaretskii >> Cc: john.b.mastro@gmail.com, 23590@debbugs.gnu.org >> >> > Grep exited abnormally with code 2 at ... >> >> Because of this: >> >> > grep: ..?*: No such file or directory > > Actually, I see that "Is a directory" also caused exit code of 2. So > I guess patches are welcome to add --directory=skip to the Grep > command when a preliminary test reveals that Grep supports it. Is the following patch acceptable? diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index f04a722..c696f75 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -573,10 +573,14 @@ This function is called from `compilation-filter-hook'." grep-template grep-find-template) (let ((grep-options (concat (if grep-use-null-device "-n" "-nH") - (if (grep-probe grep-program - `(nil nil nil "-e" "foo" ,null-device) - nil 1) - " -e")))) + (when (grep-probe grep-program + `(nil nil nil "--directories=skip" "foo" ,null-device) + nil 1) + " --directories=skip") + (when (grep-probe grep-program + `(nil nil nil "-e" "foo" ,null-device) + nil 1) + " -e")))) (unless grep-command (setq grep-command (format "%s %s %s " grep-program From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 04 10:10:05 2020 Received: (at 23590) by debbugs.gnu.org; 4 Sep 2020 14:10:05 +0000 Received: from localhost ([127.0.0.1]:40238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kECPl-00036V-1R for submit@debbugs.gnu.org; Fri, 04 Sep 2020 10:10:05 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kECPi-00035w-V4 for 23590@debbugs.gnu.org; Fri, 04 Sep 2020 10:10:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=OxWgCAEqa+XrgCfHaVHehfOkaB0c5CUq5WhQjhocO2Q=; b=qqSRiEnY9xKrvj1UwQ6AiLzSUg R5Ha1JeLCetAmLg75M36oQjH3CggiTTQrXti6lPltzeH66raZQFOKdn3rudSmkzdEXPKWHzISpXzt BC4HuBnbpRYXd5fz6eVySLDhdeTIWyWqT7fkB1P4b88/hCyLoduT37tGYZnZEyb8zOos=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kECPa-0001EC-6e; Fri, 04 Sep 2020 16:09:56 +0200 From: Lars Ingebrigtsen To: Alex Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <87fur0clhm.fsf@gmail.com> <83a8h8utdm.fsf@gnu.org> <838twsuskk.fsf@gnu.org> <87twfg0zrs.fsf@gmail.com> X-Now-Playing: Various's _1-8 Split Series_: "Ad Vanz, Gescom - Viral" Date: Fri, 04 Sep 2020 16:09:52 +0200 In-Reply-To: <87twfg0zrs.fsf@gmail.com> (Alex's message of "Sat, 23 Jul 2016 16:12:55 -0600") Message-ID: <87r1rh8wgf.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Alex writes: >> Actually, I see that "Is a directory" also caused exit code of 2. So >> I guess patches are welcome to add --directory=skip to the Grep >> command when a preliminary test reveals that Grep supports [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 23590 Cc: john.b.mastro@gmail.com, Eli Zaretskii , 23590@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Alex writes: >> Actually, I see that "Is a directory" also caused exit code of 2. So >> I guess patches are welcome to add --directory=skip to the Grep >> command when a preliminary test reveals that Grep supports it. > > Is the following patch acceptable? There was discussion here before the patch was posted, but then no follow-up. I've respun the patch for Emacs 28 -- does anybody have any comments? diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index c71a90344f..17f0422ac7 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -696,10 +696,15 @@ grep-compute-defaults (let ((grep-options (concat (if grep-use-null-device "-n" "-nH") (if grep-use-null-filename-separator " --null") - (if (grep-probe grep-program - `(nil nil nil "-e" "foo" ,null-device) - nil 1) - " -e")))) + (when (grep-probe grep-program + `(nil nil nil "--directories=skip" "foo" + ,null-device) + nil 1) + " --directories=skip") + (when (grep-probe grep-program + `(nil nil nil "-e" "foo" ,null-device) + nil 1) + " -e")))) (unless grep-command (setq grep-command (format "%s %s %s " grep-program -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 04 10:10:31 2020 Received: (at control) by debbugs.gnu.org; 4 Sep 2020 14:10:31 +0000 Received: from localhost ([127.0.0.1]:40241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kECQB-00037J-BB for submit@debbugs.gnu.org; Fri, 04 Sep 2020 10:10:31 -0400 Received: from quimby.gnus.org ([95.216.78.240]:49636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kECQ9-000376-Ez for control@debbugs.gnu.org; Fri, 04 Sep 2020 10:10:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type: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=rOq8gawGzpwsfjkOQP6XnT3+wnnYvYMAJB8oS5qhAS8=; b=lkaymFYNOEmaXTLEACz027WKrE j5VWyWobQVq0f50vX23ioHM/pSwS+X5Vnxobcnbg2jbCkCkhZBIvX4/+PMSWndVOVz3+wouo7Rze3 Qe6LvatDfyu2iHTmsflojqpqUpjX+A01URqzoETuIjJ43u/GviNsRC9uGAq4xUkTcSqE=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kECQ1-0001El-OF for control@debbugs.gnu.org; Fri, 04 Sep 2020 16:10:23 +0200 Date: Fri, 04 Sep 2020 16:10:20 +0200 Message-Id: <87pn718wfn.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #23590 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 23590 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 23590 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 06 23:42:13 2020 Received: (at 23590) by debbugs.gnu.org; 7 Oct 2020 03:42:13 +0000 Received: from localhost ([127.0.0.1]:54721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ0LE-00070R-Sh for submit@debbugs.gnu.org; Tue, 06 Oct 2020 23:42:13 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ0L9-000705-Vn for 23590@debbugs.gnu.org; Tue, 06 Oct 2020 23:42:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3i4g/9bYokBHrhjXdV96txZZhArQuvAqhXuuSye9+Is=; b=qZZXqrrpETU/QgnPgp5dCTjavr +GP8dg/Le4/nY8EuMN+Bay7ROiHUd2D8GKthQf9REJSVJAz1bqhwm27srGBKM7J09R1ZKrAti8KwS JDL1zlvC9nOfNjgFoEZ2SaToqD6lcRZTeQpnN92Z96u6GVGQ+in7hq6EVnzUscaKYIH8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQ0L0-0000gm-In; Wed, 07 Oct 2020 05:42:01 +0200 From: Lars Ingebrigtsen To: Alex Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <87fur0clhm.fsf@gmail.com> <83a8h8utdm.fsf@gnu.org> <838twsuskk.fsf@gnu.org> <87twfg0zrs.fsf@gmail.com> <87r1rh8wgf.fsf@gnus.org> X-Now-Playing: Spektrum's _Enter The Spektrum_: "Listen Girl" Date: Wed, 07 Oct 2020 05:41:56 +0200 In-Reply-To: <87r1rh8wgf.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 04 Sep 2020 16:09:52 +0200") Message-ID: <871ria7ldn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > There was discussion here before the patch was posted, but then no > follow-up. I've respun the patch for Emacs 28 -- does anybody have any > comments? There were no comments in a month, and the patch makes sense to me, so I've applied it to Emacs 28. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 23590 Cc: john.b.mastro@gmail.com, Eli Zaretskii , 23590@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > There was discussion here before the patch was posted, but then no > follow-up. I've respun the patch for Emacs 28 -- does anybody have any > comments? There were no comments in a month, and the patch makes sense to me, so I've applied it to Emacs 28. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 06 23:42:14 2020 Received: (at control) by debbugs.gnu.org; 7 Oct 2020 03:42:14 +0000 Received: from localhost ([127.0.0.1]:54723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ0LG-00070e-50 for submit@debbugs.gnu.org; Tue, 06 Oct 2020 23:42:14 -0400 Received: from quimby.gnus.org ([95.216.78.240]:39630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ0LE-00070F-KO for control@debbugs.gnu.org; Tue, 06 Oct 2020 23:42:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type: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=JwzyxaHGIEawiFZ1JTvHbgm6dmf7c961lhdOQkq13ZA=; b=tezhMcIuemohiNu5dld/YaC20c 3rpf28GVHyxmPAPhakxSa0sSgn9N9Suxoo8+/eh3biU1WIUXZg3ZUuhOF1vol4yWfOmyXon3drIVa /SjAgOjP180o40Zcv5YMiG+4yMlrHdFXLeBPoT73gDRzMQ5WXvi2JVEL848yVWtSBDy0=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQ0L6-0000gy-TJ for control@debbugs.gnu.org; Wed, 07 Oct 2020 05:42:07 +0200 Date: Wed, 07 Oct 2020 05:42:04 +0200 Message-Id: <87zh4y66sz.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #23590 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 23590 fixed close 23590 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 23590 fixed close 23590 28.1 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 07 04:17:47 2020 Received: (at 23590) by debbugs.gnu.org; 7 Oct 2020 08:17:47 +0000 Received: from localhost ([127.0.0.1]:55132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ4dv-0005oe-HI for submit@debbugs.gnu.org; Wed, 07 Oct 2020 04:17:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQ4dt-0005oQ-RE for 23590@debbugs.gnu.org; Wed, 07 Oct 2020 04:17:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41661) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQ4dn-0007uV-Ds; Wed, 07 Oct 2020 04:17:39 -0400 Received: from [176.228.60.248] (port=2810 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kQ4dg-000411-0C; Wed, 07 Oct 2020 04:17:39 -0400 Date: Wed, 07 Oct 2020 11:17:37 +0300 Message-Id: <837ds2a1r2.fsf@gnu.org> From: Eli Zaretskii To: Lars Ingebrigtsen In-Reply-To: <871ria7ldn.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed, 07 Oct 2020 05:41:56 +0200) Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <87fur0clhm.fsf@gmail.com> <83a8h8utdm.fsf@gnu.org> <838twsuskk.fsf@gnu.org> <87twfg0zrs.fsf@gmail.com> <87r1rh8wgf.fsf@gnus.org> <871ria7ldn.fsf@gnus.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 23590 Cc: john.b.mastro@gmail.com, 23590@debbugs.gnu.org, agrambot@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Lars Ingebrigtsen > Cc: john.b.mastro@gmail.com, Eli Zaretskii , > 23590@debbugs.gnu.org > Date: Wed, 07 Oct 2020 05:41:56 +0200 > > Lars Ingebrigtsen writes: > > > There was discussion here before the patch was posted, but then no > > follow-up. I've respun the patch for Emacs 28 -- does anybody have any > > comments? > > There were no comments in a month, and the patch makes sense to me, so > I've applied it to Emacs 28. I'm sorry to not have chimed earlier, but I think this change goes too far. Now the default "M-x grep" command includes --directories=skip if the user's Grep program supports that. This is not a good idea for the general-purpose Grep commands. For example, if the user adds to the default command "-R foo" somewhere before the --directories=skip part, the command will say "no matches", which would be a surprise at best, and at worst could mislead the user. The original bug report was about "M-x lgrep". Can we make this change affect only that command? In any case, this is a user-visible change, so it should be called out in NEWS. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 09 00:15:41 2020 Received: (at 23590) by debbugs.gnu.org; 9 Oct 2020 04:15:41 +0000 Received: from localhost ([127.0.0.1]:33789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQjoj-0004mO-72 for submit@debbugs.gnu.org; Fri, 09 Oct 2020 00:15:41 -0400 Received: from quimby.gnus.org ([95.216.78.240]:33728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQjoh-0004m7-Mu for 23590@debbugs.gnu.org; Fri, 09 Oct 2020 00:15:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QfnozOT17zOGEbWwb9amGXHEM7gVj/2hqujsBYAdZXw=; b=X5YY5umP/1rKMT4GxZYMLuiVqr PR5oTLdBI+WFwyX6+g4xwlaVt2dfIjTsOF4AwQhwpzFaSAAFEizuG4aKXgN1Hqn7wYFlNxzw429OV B99J8v4QSpyq2FcN8SlkZf+bdDfWtMgHK9EBmJw34V1mOBq1Sw9IPzDeE/YobF6pD8dY=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQjoV-0007b4-5a; Fri, 09 Oct 2020 06:15:33 +0200 From: Lars Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <87fur0clhm.fsf@gmail.com> <83a8h8utdm.fsf@gnu.org> <838twsuskk.fsf@gnu.org> <87twfg0zrs.fsf@gmail.com> <87r1rh8wgf.fsf@gnus.org> <871ria7ldn.fsf@gnus.org> <837ds2a1r2.fsf@gnu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEXa6M+8y7S22sb/ //+WyP7WAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+QKCQQPC2H6yYQAAAGaSURBVCjPNZGxauNAEIZH QjGOKgekFKl0ghhHT6EE0rhywq3Bqq6xsfYpZEgg5+qKrDipEgcrNP9T3qxsDWLgW80/8+8s3SgX dszkYK/2vHbgSdqVZUUuHKitMmMZPRwaFI3JiQKi+63A7vS8iX8SpdrWur1oKOGedfNnAobeXRp4 RdEW2/21LIPEocon4GkoZTWD8UH5xkGLlvlTqRHkvOxjFS/Em65bgatmJR0sn64QQjNMPgFKVDRS MuulxWQ0dFOHpnbetLhhSb276RO0Zv0XvRFIz9CNXgkUF9es5y0rI3+kvDxSZtWegvQ7AR/Jt0pT kDlYS7nZUaS/V2jX8/dHaR2lCwpZhs/UQTSypc53e5ajZHOx5dmlwC9fXMpnS9HkYUfuAvEr3W2P y6EL57BiIEq//EEk5+qVnFEHIZIbofRfBqIl5nEuc+SmFQE/lFuiD+R0Rvi2kSfpgYFqZEamP7gn oRmcPkp8nE90i9/PC4oefYyt2XgUxS8QOzO45QTRCLewyqNAlXUHCltr3ih6ytANLxlL2X8T4bLX 0vYVIAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMC0xMC0wOVQwNDoxNToxMSswMDowMDlDJlIAAAAl dEVYdGRhdGU6bW9kaWZ5ADIwMjAtMTAtMDlUMDQ6MTU6MTErMDA6MDBIHp7uAAAAAElFTkSuQmCC X-Now-Playing: B. Fleischmann & Herbert Weixelbaum's _Duo505: Late_: "Disko+Bett" Date: Fri, 09 Oct 2020 06:15:25 +0200 In-Reply-To: <837ds2a1r2.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 07 Oct 2020 11:17:37 +0300") Message-ID: <87k0w06nmq.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eli Zaretskii writes: > The original bug report was about "M-x lgrep". Can we make this > change affect only that command? > > In any case, this is a user-visible change, so it should be called out > in NEWS. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 23590 Cc: john.b.mastro@gmail.com, 23590@debbugs.gnu.org, agrambot@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > The original bug report was about "M-x lgrep". Can we make this > change affect only that command? > > In any case, this is a user-visible change, so it should be called out > in NEWS. Yup, and yup. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 13 16:19:31 2020 Received: (at 23590) by debbugs.gnu.org; 13 Oct 2020 20:19:31 +0000 Received: from localhost ([127.0.0.1]:48996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSQlf-00029S-GG for submit@debbugs.gnu.org; Tue, 13 Oct 2020 16:19:31 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:50101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSQlc-00029D-RJ for 23590@debbugs.gnu.org; Tue, 13 Oct 2020 16:19:30 -0400 X-Originating-IP: 91.129.102.160 Received: from mail.gandi.net (m91-129-102-160.cust.tele2.ee [91.129.102.160]) (Authenticated sender: juri@linkov.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 7AB9D1BF205; Tue, 13 Oct 2020 20:19:21 +0000 (UTC) From: Juri Linkov To: Lars Ingebrigtsen Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command Organization: LINKOV.NET References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <87fur0clhm.fsf@gmail.com> <83a8h8utdm.fsf@gnu.org> <838twsuskk.fsf@gnu.org> <87twfg0zrs.fsf@gmail.com> <87r1rh8wgf.fsf@gnus.org> <871ria7ldn.fsf@gnus.org> <837ds2a1r2.fsf@gnu.org> <87k0w06nmq.fsf@gnus.org> Date: Tue, 13 Oct 2020 23:09:22 +0300 In-Reply-To: <87k0w06nmq.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 09 Oct 2020 06:15:25 +0200") Message-ID: <87imbej8vh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 23590 Cc: john.b.mastro@gmail.com, Eli Zaretskii , 23590@debbugs.gnu.org, agrambot@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain >> The original bug report was about "M-x lgrep". Can we make this >> change affect only that command? >> >> In any case, this is a user-visible change, so it should be called out >> in NEWS. > > Yup, and yup. The latest fix has two problems: 1. it runs grep-probe every time lgrep is used; 2. it adds --directories=skip to the end of the command after regexp and file names This patch improves both: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=grep-use-directories-skip.patch diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index f028a4279d..9b1dc337e8 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -959,10 +959,10 @@ grep-expand-keywords these include `opts', `dir', `files', `null-device', `excl' and `regexp'.") -(defun grep-expand-template (template &optional regexp files dir excl) +(defun grep-expand-template (template &optional regexp files dir excl more-opts) "Expand grep COMMAND string replacing , , , , and ." (let* ((command template) - (env `((opts . ,(let (opts) + (env `((opts . ,(let ((opts more-opts)) (when (and case-fold-search (isearch-no-upper-case-p regexp t)) (push "-i" opts)) @@ -1058,6 +1058,8 @@ grep-read-files (or (cdr (assoc files grep-files-aliases)) files)))) +(defvar grep-use-directories-skip 'auto-detect) + ;;;###autoload (defun lgrep (regexp &optional files dir confirm) "Run grep, searching for REGEXP in FILES in directory DIR. @@ -1103,6 +1105,12 @@ lgrep (if (string= command grep-command) (setq command nil)) (setq dir (file-name-as-directory (expand-file-name dir))) + (unless (or (not grep-use-directories-skip) (eq grep-use-directories-skip t)) + (setq grep-use-directories-skip + (grep-probe grep-program + `(nil nil nil "--directories=skip" "foo" + ,null-device) + nil 1))) (setq command (grep-expand-template grep-template regexp @@ -1119,13 +1127,10 @@ lgrep (shell-quote-argument (cdr ignore)))))) grep-find-ignored-files - " --exclude="))))) + " --exclude="))) + (and grep-use-directories-skip + '("--directories=skip")))) (when command - (when (grep-probe grep-program - `(nil nil nil "--directories=skip" "foo" - ,null-device) - nil 1) - (setq command (concat command " --directories=skip"))) (if confirm (setq command (read-from-minibuffer "Confirm: " --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 14 00:10:35 2020 Received: (at 23590) by debbugs.gnu.org; 14 Oct 2020 04:10:35 +0000 Received: from localhost ([127.0.0.1]:49643 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSY7X-0007Vr-0d for submit@debbugs.gnu.org; Wed, 14 Oct 2020 00:10:35 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54060) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSY7V-0007Vd-4A for 23590@debbugs.gnu.org; Wed, 14 Oct 2020 00:10:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=VWY2s3r5tJVIw1/Mr1qhRbEMFyTckSQal93NnSPO7cQ=; b=K5VEsPJ0NhmUB0URPylzN0qnWd 2GI2vrhL3oerXmcUiZZXOK4wZ3CHGcLV3T0xXHZCJT0vG0yqseSxGvmPTdjR45bRs+fq3BGLEn/xK ONSRyKOwrk+lkxqORRHU4YNELY7kNI+6Cj05zeQmz5X4G7etBBM1lw+MSs/5744o9kSE=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSY7M-0004gQ-Bt; Wed, 14 Oct 2020 06:10:27 +0200 From: Lars Ingebrigtsen To: Juri Linkov Subject: Re: bug#23590: 25.0.94; Errors in default lgrep command References: <87futcp8wp.fsf@gmail.com> <83fur0x0ft.fsf@gnu.org> <87fur0clhm.fsf@gmail.com> <83a8h8utdm.fsf@gnu.org> <838twsuskk.fsf@gnu.org> <87twfg0zrs.fsf@gmail.com> <87r1rh8wgf.fsf@gnus.org> <871ria7ldn.fsf@gnus.org> <837ds2a1r2.fsf@gnu.org> <87k0w06nmq.fsf@gnus.org> <87imbej8vh.fsf@mail.linkov.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAKlBMVEX4mS/9qC/cZTXE OjnNjDGaajBCMTHJjTJrTDH8ukb7zmv8xFb23Y3///8dEh2UAAAAAWJLR0QN9rRh9QAAAAd0SU1F B+QKDgMqCmaWB8kAAAFJSURBVDjLvZM/T4QwGIdbjIlj30vJiS7YjyBfQAYS3e4SazpqornVG/wz OmhkZXDQmxwvTDdSvoHxQ0lBaAslRgffjT78nr59KQhVBWYRpAt6NQo6hseItod44oWM4Qa0AcLY Yci2WNQC0sY9FHoeQt4RVwAPdtjmlzUw+1cPd8m9M7HzLFJRgy5zzB8JTW4fUk5NVeXw51wIcROT uAKmSPhXqbiGhM9Vgmiw2H3ygfLT5uR6nZ5PZ9X6SV6ArZpewJJwXAayUEATsnhZ+jOQq/LdVsEZ hyCXZb6X9bqiMWRyvd7kYKtUZSCL/Q3YB/wuGdQADz9spiKDGb4Wb8Wqd8BG9PlR1ioYKecNAZfq 58R/7PFbFakS5nUwgLrU2Kly/1F/BM6OEbE3p3qICKx227cQiXqmFnhR6Fgegs6LJtGBe4hj33B0 7F+qim5HHhx/gQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMC0xMC0xNFQwMzo0MjoxMCswMDowMP8g FZ8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjAtMTAtMTRUMDM6NDI6MTArMDA6MDCOfa0jAAAAAElF TkSuQmCC X-Now-Playing: B. Fleischmann's _Welcome Tourist (1)_: "As If" Date: Wed, 14 Oct 2020 06:10:22 +0200 In-Reply-To: <87imbej8vh.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 13 Oct 2020 23:09:22 +0300") Message-ID: <87eem11m8h.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Juri Linkov writes: > 1. it runs grep-probe every time lgrep is used; > 2. it adds --directories=skip to the end of the command after regexp > and file names > > This patch improves both: Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 23590 Cc: john.b.mastro@gmail.com, Eli Zaretskii , 23590@debbugs.gnu.org, agrambot@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: > 1. it runs grep-probe every time lgrep is used; > 2. it adds --directories=skip to the end of the command after regexp > and file names > > This patch improves both: Looks good; go ahead and push. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Sep 05 11:02:01 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 11 Nov 2020 12:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator