[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unexpected behavior of grep-use-null-device in non-interactive mode
From: |
david.chappaz |
Subject: |
Re: Unexpected behavior of grep-use-null-device in non-interactive mode |
Date: |
Tue, 23 Feb 2021 18:47:45 -0800 |
> The function that auto-detects null-device support is only called when
> you invoke the command interactively. And the doc string actually
> says so:
Thanks for pointing that out, it makes sense !
In my non-interactive variant though, 'grep' is not called interactively at
any point.
* The result from step 3 doesn't contradict the fact that
auto-detection for the null-device support only takes place when you invoke
the command interactively.
* However, the transition from step 3 to step 4 shows that
grep-use-null-device is changed (to nil) from 'auto-detect', so some kind of
auto-detection seems to have taken place
* Furthermore, results from step 5 (in contrast to the results from
step 3) clearly show that auto-detection has taken place, despite the
absence of any interactive invocation.
In a few words, if I read the documentation correctly, I would expect
grep-use-null-device to be changed from 'auto-detect' on the first
*interactive* invocation, but never before that. Am I right ?
> Why do you need to call 'grep' noninteractively, and still want it to
> show the hits as if it were an interactive call?
Although I love emacs, I'm very inexperienced in elisp and there is no doubt
many people would scream when looking at my very obscure elisp functions.
In this particular case, I'm building a wrapper around 'grep', very much
inspired by this:
https://ideoplex.com/2014/08/03/emacs-windows-and-ack/
The only difference is that my own wrapper has some interactive steps at the
beginning, e.g. to ask for the pattern to search, to ask for the folder
where to search from, etc... Eventually it builds a command and calls 'grep'
non-interactively.
David