From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Unexpected behavior of grep-use-null-device in non-interactive mode
Date: Tue, 23 Feb 2021 19:24:16 +0200 [thread overview]
Message-ID: <83wnuyu27z.fsf@gnu.org> (raw)
In-Reply-To: <030c01d7096e$82aa7260$87ff5720$@free.fr> (david.chappaz@free.fr)
> From: <david.chappaz@free.fr>
> Date: Mon, 22 Feb 2021 15:00:24 -0800
>
> Why is /dev/null added to the command at step 3 ?
>
> Is this a bug ? Or perhaps my expectations are not quite right ?
The function that auto-detects null-device support is only called when
you invoke the command interactively. And the doc string actually
says so:
(defcustom grep-use-null-device 'auto-detect
"If t, append the value of `null-device' to `grep' commands.
This is done to ensure that the output of grep includes the filename of
any match in the case where only a single file is searched, and is not
necessary if the grep program used supports the `-H' option.
In interactive usage, the actual value of this variable is set up
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
by `grep-compute-defaults'
^^^^^^^^^^^^^^^^^^^^^^^^^
Why do you need to call 'grep' noninteractively, and still want it to
show the hits as if it were an interactive call?
next prev parent reply other threads:[~2021-02-23 17:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-22 23:00 Unexpected behavior of grep-use-null-device in non-interactive mode david.chappaz
2021-02-23 17:24 ` Eli Zaretskii [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-02-24 2:47 david.chappaz
2021-02-24 16:53 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83wnuyu27z.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).