GNU bug report logs - #46801
Autodetection of grep-use-null-device

Previous Next

Package: emacs;

Reported by: <david.chappaz <at> free.fr>

Date: Fri, 26 Feb 2021 17:57:01 UTC

Severity: minor

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46801 in the body.
You can then email your comments to 46801 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#46801; Package emacs. (Fri, 26 Feb 2021 17:57:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to <david.chappaz <at> free.fr>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 26 Feb 2021 17:57:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: <david.chappaz <at> free.fr>
To: <bug-gnu-emacs <at> gnu.org>
Subject: Autodetection of grep-use-null-device 
Date: Fri, 26 Feb 2021 09:10:51 -0800
[Message part 1 (text/plain, inline)]
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

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46801; Package emacs. (Sat, 27 Feb 2021 05:04:02 GMT) Full text and rfc822 format available.

Message #8 received at 46801 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: <david.chappaz <at> free.fr>
Cc: 46801 <at> debbugs.gnu.org
Subject: Re: bug#46801: Autodetection of grep-use-null-device 
Date: Sat, 27 Feb 2021 06:03:46 +0100
<david.chappaz <at> free.fr> 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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 27 Feb 2021 05:05:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 46801 <at> debbugs.gnu.org and <david.chappaz <at> free.fr> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 27 Feb 2021 05:05:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46801; Package emacs. (Sun, 28 Feb 2021 01:41:02 GMT) Full text and rfc822 format available.

Message #15 received at 46801 <at> debbugs.gnu.org (full text, mbox):

From: <david.chappaz <at> free.fr>
To: "'Lars Ingebrigtsen'" <larsi <at> gnus.org>
Cc: 46801 <at> debbugs.gnu.org
Subject: RE: bug#46801: Autodetection of grep-use-null-device 
Date: Sat, 27 Feb 2021 17:39:56 -0800
-----Original Message-----
From: bug-gnu-emacs <bug-gnu-emacs-bounces+david.chappaz=free.fr <at> gnu.org> 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





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 28 Mar 2021 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.