all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#46801: Autodetection of grep-use-null-device
@ 2021-02-26 17:10 david.chappaz
  2021-02-27  5:03 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: david.chappaz @ 2021-02-26 17:10 UTC (permalink / raw)
  To: 46801

[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]

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


[-- Attachment #2: Type: text/html, Size: 4254 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#46801: Autodetection of grep-use-null-device
  2021-02-26 17:10 bug#46801: Autodetection of grep-use-null-device david.chappaz
@ 2021-02-27  5:03 ` Lars Ingebrigtsen
  2021-02-28  1:39   ` david.chappaz
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-27  5:03 UTC (permalink / raw)
  To: david.chappaz; +Cc: 46801

<david.chappaz@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#46801: Autodetection of grep-use-null-device
  2021-02-27  5:03 ` Lars Ingebrigtsen
@ 2021-02-28  1:39   ` david.chappaz
  0 siblings, 0 replies; 3+ messages in thread
From: david.chappaz @ 2021-02-28  1:39 UTC (permalink / raw)
  To: 'Lars Ingebrigtsen'; +Cc: 46801

-----Original Message-----
From: bug-gnu-emacs <bug-gnu-emacs-bounces+david.chappaz=free.fr@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






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-28  1:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-26 17:10 bug#46801: Autodetection of grep-use-null-device david.chappaz
2021-02-27  5:03 ` Lars Ingebrigtsen
2021-02-28  1:39   ` david.chappaz

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.