all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: <david.chappaz@free.fr>
To: <help-gnu-emacs@gnu.org>
Subject: Re: Unexpected behavior of grep-use-null-device in non-interactive mode
Date: Tue, 23 Feb 2021 18:47:45 -0800	[thread overview]
Message-ID: <03c501d70a57$6fdb1420$4f913c60$@free.fr> (raw)

 

> 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

 



             reply	other threads:[~2021-02-24  2:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-24  2:47 david.chappaz [this message]
2021-02-24 16:53 ` Unexpected behavior of grep-use-null-device in non-interactive mode Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2021-02-22 23:00 david.chappaz
2021-02-23 17:24 ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='03c501d70a57$6fdb1420$4f913c60$@free.fr' \
    --to=david.chappaz@free.fr \
    --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.
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.