Emilio Lopes <[EMAIL PROTECTED]> writes: > Emilio Lopes writes: > >> As a result, if I forget to provide a filename to "M-x grep" it will >> run forever, waiting for me to kill it. > > Richard M Stallman writes: > >> So, my grep program supports "-H" but it apparently has not the >> expected semantics. > >> That is a very vague statement. It tells us nothing. > > No, no. It's very concrete if you consider the rest of the message, > which you didn't quote. Anyway, I understand the problem better now. > > 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). > > One could even argue if Emacs should not append *two* instances of > `null-device', in the case the use just press enter at the grep prompt > without even typing a regexp.
I think what rather should be done is that standard input on the grep process gets closed. That requires no special options, and it will lead to a sensible result without obscure extra options. grep-use-null-device is just for getting file names on matches, not for dealing with bad commands. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel