From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Unexpected behavior of grep-use-null-device in non-interactive mode Date: Mon, 22 Feb 2021 15:00:24 -0800 Message-ID: <030c01d7096e$82aa7260$87ff5720$@free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16895"; mail-complaints-to="usenet@ciao.gmane.io" To: Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 23 00:20:06 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEKUn-0004HZ-Sg for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 23 Feb 2021 00:20:05 +0100 Original-Received: from localhost ([::1]:45350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEKUm-0000uF-RI for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 22 Feb 2021 18:20:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEKBz-0002gN-2a for help-gnu-emacs@gnu.org; Mon, 22 Feb 2021 18:00:39 -0500 Original-Received: from smtp4-g21.free.fr ([2a01:e0c:1:1599::13]:24952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEKBw-0006ZB-Ny for help-gnu-emacs@gnu.org; Mon, 22 Feb 2021 18:00:38 -0500 Original-Received: from DCHAPPAZ (unknown [70.95.74.148]) (Authenticated sender: david.chappaz@free.fr) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 2D2DB19F4C8 for ; Tue, 23 Feb 2021 00:00:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1614034827; bh=hn+OuXILDujOOujvrQ29fkIcGBa3pLRAn01KVK/Ja1E=; h=From:To:Subject:Date:From; b=PTobfA3DYTOl2ihjM7Od2yE1peXefGoSA3Ud7ucL9R2oeFHAv8oc55DYCZ3yAsNKh n4quUlGur2r803ObZmGAYNZxPo04xXrEwdgeci7smR9h+zFZhgvrs7Y8Zd9u+MroaN JahaIahBBA11P7lG2s1nUV13cwMYhnn21eJT5hikhzCK8VCWvWaUnfjkQqx0wf/cB0 zu7H+pPseom5ZqMdol8TEiM8SoWy6d7TrvmcOKgjlpRPmJ1eZLTC/GU9nBHB5yrckC m6B8yIt5d40q10G6Y/P7hhpfmT5d2RNG330J4dQxSOG/EshvnE1i+CWkT+DFehEFzA c33ub36CMZjbw== X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdcJbkNNxV/I0e3SQua4mUbmKZ1Ckg== Content-Language: en-us Received-SPF: pass client-ip=2a01:e0c:1:1599::13; envelope-from=david.chappaz@free.fr; helo=smtp4-g21.free.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 22 Feb 2021 18:19:30 -0500 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128207 Archived-At: Hi, I'm using emacs 27.1. Here is a simple experiment in interactive mode: 1/ Start emacs with --no-init 2/ I can check that grep-use-null-device is set to 'auto-detect' 3/ Run interactively M-x grep, something. The command that's echoed in the grep buffer is: grep --color -nH --null -e something 4/ I can check that grep-use-null-device has been set to nil So far so good. Now consider the non-interactive variant: 1/ Start emacs with --no-init 2/ I can check that grep-use-null-device is set to 'auto-detect' 3/ Now I execute non- interactively (grep "grep --color -nH --null -e something") . The command that's echoed in the grep buffer is: grep --color -nH --null -e something /dev/null 4/ I can check that grep-use-null-device has been set to nil 5/ If I execute non- interactively the same (grep "grep --color -nH --null -e something"), the command that's echoed in the grep buffer now is: grep --color -nH --null -e something Why is /dev/null added to the command at step 3 ? Is this a bug ? Or perhaps my expectations are not quite right ? Thanks ! David