all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: grep-use-null-device
Date: Tue, 16 Aug 2005 12:45:17 +0300	[thread overview]
Message-ID: <87mznichva.fsf@jurta.org> (raw)
In-Reply-To: <u17jemnyis.fsf@tiscali.de> (Emilio Lopes's message of "Tue, 16 Aug 2005 09:15:07 +0200")

> If the user forgets to provide a filename to "M-x grep" (as in
> "grep -nH foo") it will run indefinitely waiting for input from
> stdin until killed.  In such cases it's useful to have `null-device'
> appended, even if the grep program supports the option "-H" (which
> has an other purpose anyway).

Sometimes I miss a space between the regexp and the file name,
i.e. instead of `grep -nH foo *' I type `grep -nH foo*' where
`foo*' is interpreted by grep as a regexp with the empty file name.
It takes some time before starting to worry why grep doesn't finish.

`/dev/null' you proposed is of no help.  It causes grep to print the
finishing message `no matches found' which gives the false impression
that the search string was not found by grep.  This is worse than
forcing you to type C-c C-k to kill the grep process that helps you
to discover your mistake.

Maybe grep.el should try to parse the grep command line and warn the
user about a missing file name (e.g. by highlighting the command in
the grep buffer in `compilation-error' face).  This helps to notice
the mistake sooner, but parsing the command is an unreliable method.

-- 
Juri Linkov
http://www.jurta.org/emacs/

      parent reply	other threads:[~2005-08-16  9:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-15 15:41 grep-use-null-device Emilio Lopes
2005-08-16  2:25 ` grep-use-null-device Richard M. Stallman
2005-08-16 11:46   ` grep-use-null-device Karl Chen
2005-08-16 16:20     ` grep-use-null-device Emilio Lopes
2005-08-17  6:25       ` grep-use-null-device Richard M. Stallman
2005-08-20 12:22         ` grep-use-null-device Eli Zaretskii
2005-08-27  1:30           ` "^D^H^H" in process output on Darwin (Was Re: grep-use-null-device) YAMAMOTO Mitsuharu
2005-08-29 13:56             ` "^D^H^H" in process output on Darwin Stefan Monnier
2005-09-13  8:21             ` Nozomu Ando
2005-09-17  1:33               ` YAMAMOTO Mitsuharu
2005-08-29 22:43           ` grep-use-null-device Juri Linkov
2005-08-30 10:30             ` grep-use-null-device Richard M. Stallman
2005-08-31  2:31             ` grep-use-null-device Stefan Monnier
2005-08-31  6:02               ` grep-use-null-device Juri Linkov
2005-09-01 14:59                 ` grep-use-null-device Stefan Monnier
2005-09-01 16:16                   ` grep-use-null-device David Kastrup
2005-09-01 18:18                     ` grep-use-null-device Stefan Monnier
2005-09-03  1:43                     ` grep-use-null-device Richard M. Stallman
2005-08-16  7:15 ` grep-use-null-device Emilio Lopes
2005-08-16  9:26   ` grep-use-null-device David Kastrup
2005-08-16 16:29     ` grep-use-null-device Emilio Lopes
2005-08-16  9:45   ` Juri Linkov [this message]

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=87mznichva.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@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.