From unknown Sat Jun 14 03:51:11 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#46801 <46801@debbugs.gnu.org> To: bug#46801 <46801@debbugs.gnu.org> Subject: Status: Autodetection of grep-use-null-device Reply-To: bug#46801 <46801@debbugs.gnu.org> Date: Sat, 14 Jun 2025 10:51:11 +0000 retitle 46801 Autodetection of grep-use-null-device=20 reassign 46801 emacs submitter 46801 severity 46801 minor tag 46801 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 26 12:56:40 2021 Received: (at submit) by debbugs.gnu.org; 26 Feb 2021 17:56:40 +0000 Received: from localhost ([127.0.0.1]:42328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFhLz-0005Tx-Kc for submit@debbugs.gnu.org; Fri, 26 Feb 2021 12:56:40 -0500 Received: from lists.gnu.org ([209.51.188.17]:37264) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFgdu-0002F0-4V for submit@debbugs.gnu.org; Fri, 26 Feb 2021 12:11:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFgdt-00077J-Rz for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2021 12:11:05 -0500 Received: from smtp4-g21.free.fr ([212.27.42.4]:64102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFgdo-0002Mo-Mt for bug-gnu-emacs@gnu.org; Fri, 26 Feb 2021 12:11:05 -0500 Received: from DCHAPPAZ (unknown [70.95.74.148]) (Authenticated sender: david.chappaz@free.fr) by smtp4-g21.free.fr (Postfix) with ESMTPSA id CC8FB19F576 for ; Fri, 26 Feb 2021 18:10:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1614359455; bh=hGdLK5rtcvvwxl3jxX66YTRR0rDw+ElIB8nhkGeZ3Xc=; h=From:To:Subject:Date:From; b=ptwr1I6InbGylXyZQZxnGo7zMpihjlJyk9+iBcrMIfL4Iv+2UvEWfwdvJIvWYuzzD mMGRZXPy03nq1lU+gVjF5VUffIrP94HGd8A2gZ7Px1IsZ8wn8FWNGlqmkEEfU/R1ed vgNT3CW53MnwDxmmqn9peohh6/Hu0AAUMJhY0b1Zf1Sz9dSgawCfLLeA+y7YOusnfR c+hQanOaRWD6kPtH+JYa3slK5p52DaX5vuDgp6qrqLIWjymIR7i5/w9VJte88PapLq tmF7m3JOCu5CK1ftsjQ2f3JiaCawTqL5TP3h5BqX+guMWL2oIiKEvdL8E5n5FhR9zm EcC+DoIJ0N0GA== From: To: Subject: Autodetection of grep-use-null-device Date: Fri, 26 Feb 2021 09:10:51 -0800 Message-ID: <055601d70c62$57d58ba0$0780a2e0$@free.fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0557_01D70C1F.49B33600" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AdcMYcE7cRn0GYfeQZuC7idTG9x6Ow== Content-Language: en-us Received-SPF: pass client-ip=212.27.42.4; 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, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 26 Feb 2021 12:56:38 -0500 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: -2.6 (--) This is a multipart message in MIME format. ------=_NextPart_000_0557_01D70C1F.49B33600 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, Here is a simple recipe: 1/ Start emacs with --no-init 2/ Check that grep-use-null-device is set to 'auto-detect' 3/ 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 see that grep-use-null-device has been set to nil This suggests that automatic detection of grep-use-null-device has taken place. Is this expected after non-interactive invocation ? The documentation seems to suggest that automatic detection of grep-use-null-device should take place on the first *interactive* call, but not before that. Perhaps I don't read the documentation correctly though, it's very possible ! However, if automatic detection of grep-use-null-device after non-interactive Invocation is the correct behavior, then why was /dev/null added to the command despite grep-use-null-device being set to nil ? 5/ Execute non-interactively the same command again: (grep "grep --color -nH --null -e something") The command that's echoed in the grep buffer now is: grep --color -nH --null -e something This time round, /dev/null is not present. At least this is consistent with grep-use-null-device being set to nil. What doesn't seem right is that the echoed command is not the same as that from step 3/ Any thoughts or comments ? Thanks ! David ------=_NextPart_000_0557_01D70C1F.49B33600 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi,

 

Here is a = simple recipe:

 

1/ Start = emacs with --no-init

 

2/ Check = that grep-use-null-device is set to = ‘auto-detect’

 

3/ 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 see that grep-use-null-device has been set to = nil

 

This suggests that automatic detection of = grep-use-null-device

has taken place. = Is this expected after non-interactive invocation ?

 

The = documentation seems to suggest that automatic detection = of

grep-use-null-device should  = take place on the first *interactive*

call, but not before that. Perhaps I don't read the = documentation

correctly though, it's = very possible !

 

However, if = automatic detection of grep-use-null-device after non-interactive =

Invocation is the correct behavior, = then why was /dev/null added to the

command despite grep-use-null-device being set to nil = ?

5/ Execute non-interactively the same command = again:

(grep "grep --color -nH = --null -e something")

 

The command = that’s echoed in the grep buffer now is:

grep --color -nH --null -e something

 

This time = round, /dev/null is not present. At least this is consistent = with

grep-use-null-device being set = to nil.

What doesn't seem right is = that the echoed command is not the same as

that from step 3/

 

Any thoughts = or comments ?

Thanks = !

David

------=_NextPart_000_0557_01D70C1F.49B33600-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 27 00:03:59 2021 Received: (at 46801) by debbugs.gnu.org; 27 Feb 2021 05:03:59 +0000 Received: from localhost ([127.0.0.1]:43025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFrlm-0000Xi-No for submit@debbugs.gnu.org; Sat, 27 Feb 2021 00:03:58 -0500 Received: from quimby.gnus.org ([95.216.78.240]:43692) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFrlk-0000XU-Hw for 46801@debbugs.gnu.org; Sat, 27 Feb 2021 00:03:57 -0500 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=zTkN3oDI04vrbYYPAlOBM+mNlTG8bIfLDNRJcWtRPyU=; b=oEJdvQa/qnV99tWuDV2Orrh5VN BX4aua9U68Djp8EFDdfCKifjDWtLUw2CXGX1B7hwC6rgxV78TUlFYcOsvJYfpqEZ28ieDhIudmLKB 2lzVXOCwSReJrCC7dT+7Wrg8A8EUUYXImR/6RXVfdxKTnnHlRyHGE3DTsr2Z6kDxe7UY=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFrlc-00028x-6n; Sat, 27 Feb 2021 06:03:50 +0100 From: Lars Ingebrigtsen To: Subject: Re: bug#46801: Autodetection of grep-use-null-device References: <055601d70c62$57d58ba0$0780a2e0$@free.fr> X-Now-Playing: Tuxedomoon's _Live in London (1982)_: =?utf-8?Q?=22Lumi?= =?utf-8?Q?=C3=A8re=22?= Date: Sat, 27 Feb 2021 06:03:46 +0100 In-Reply-To: <055601d70c62$57d58ba0$0780a2e0$@free.fr> (david chappaz's message of "Fri, 26 Feb 2021 09:10:51 -0800") Message-ID: <87blc6je4t.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: writes: > 4/ I can see that grep-use-null-device has been set to nil > > This suggests that automatic detection of grep-use-null-device > > has taken place. Is this expected after non-interactive invocation ? 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: 46801 Cc: 46801@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 (-) writes: > 4/ I can see that grep-use-null-device has been set to nil > > This suggests that automatic detection of grep-use-null-device > > has taken place. Is this expected after non-interactive invocation ? It's always computed -- by `grep-process-setup', but that's after the grep command is constructed, which is why you're getting that "/dev/null" at the end, and then the variable is set to nil. I've now changed this in Emacs 28 to compute the value earlier, so this is less inconsistent (and I've also updated the doc string). -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 27 00:04:02 2021 Received: (at control) by debbugs.gnu.org; 27 Feb 2021 05:04:02 +0000 Received: from localhost ([127.0.0.1]:43028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFrlq-0000Y3-0r for submit@debbugs.gnu.org; Sat, 27 Feb 2021 00:04:02 -0500 Received: from quimby.gnus.org ([95.216.78.240]:43706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFrlp-0000XZ-Ca for control@debbugs.gnu.org; Sat, 27 Feb 2021 00:04:01 -0500 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=ohIwSqB5ao7AXJBcXyCS2KcLeJ+XcDZQt0Kk7lrsAHU=; b=rOLv52FUeyRxtzErJpzC4L6DxU vl3wT9PRChJi+/nsK0tAEdb3D89HDCCjU3tPsWzS74gBnwHO/ndW5u5yMTqOfFX3OOjILgwygzy9p rCeIhg/EkdW4DCOhNrhpjCjzt5ineY72DXSkw7kgKps4Egi+hqxPdLCXJ0gqVqOrG+Kg=; Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lFrlh-000294-QN for control@debbugs.gnu.org; Sat, 27 Feb 2021 06:03:55 +0100 Date: Sat, 27 Feb 2021 06:03:52 +0100 Message-Id: <87a6rqje4n.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #46801 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 46801 fixed close 46801 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 46801 fixed close 46801 28.1 quit From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 27 20:40:04 2021 Received: (at 46801) by debbugs.gnu.org; 28 Feb 2021 01:40:04 +0000 Received: from localhost ([127.0.0.1]:45602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGB40-0005Wo-IK for submit@debbugs.gnu.org; Sat, 27 Feb 2021 20:40:04 -0500 Received: from smtp4-g21.free.fr ([212.27.42.4]:63970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lGB3y-0005Wf-OG for 46801@debbugs.gnu.org; Sat, 27 Feb 2021 20:40:03 -0500 Received: from DCHAPPAZ (unknown [70.95.74.148]) (Authenticated sender: david.chappaz@free.fr) by smtp4-g21.free.fr (Postfix) with ESMTPSA id B38E919F4EA; Sun, 28 Feb 2021 02:39:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=free.fr; s=smtp-20201208; t=1614476401; bh=20ZBmJmPfDAAY6ra5EUS+4SycWV1TveCmVOY09TegG8=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=cPXxzRozQ9e/UTT1CbtXhefHKv4TBlTFQGL1ywaxOmPKQp7cZsQGVMCA7XJcwreyC QFb6EybwTF2szlaYZ77fYRkx81xOMel+Hinzv657Ll/MSOalscvbvjNgrUqUEvhS5d tUqJ0jxvRvjZIWzrg+Yd4aLSEj4duPzv7YbjkwbrWltCHPNoZw8dHiyVd5IWBgZCyd hwldnhuSP72pLAEtq/yqje3Rbvz4Dy9diiDPgh+oSY3VGbgAy1V8Nrq6H+YALByZQx rBe+b/jMacYE6luICQ0dWl2yoOWTIyhDM508rd0fNWPPqn5/UzkURR8UB+ABzEWeFO UdkX4bBxbKDzg== From: To: "'Lars Ingebrigtsen'" References: <055601d70c62$57d58ba0$0780a2e0$@free.fr> <87blc6je4t.fsf@gnus.org> In-Reply-To: <87blc6je4t.fsf@gnus.org> Subject: RE: bug#46801: Autodetection of grep-use-null-device Date: Sat, 27 Feb 2021 17:39:56 -0800 Message-ID: <065101d70d72$a19246f0$e4b6d4d0$@free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHvo9e8cemW5nHqqEg71mB2sfgQXwGkeu//qi55P7A= Content-Language: en-us X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 46801 Cc: 46801@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 (-) -----Original Message----- From: bug-gnu-emacs = On Behalf Of = Lars Ingebrigtsen > I've now changed this in Emacs 28 to compute the value earlier, so = this is less inconsistent (and I've also updated the doc string). Brilliant, thanks for the confirmation and for the very quick change ! David From unknown Sat Jun 14 03:51:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 28 Mar 2021 11:24:04 +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