From: Lars Ingebrigtsen Date: Wed, 19 Aug 2020 10:55:46 +0000 (+0200) Subject: Signal an end-of-file error upon errors when reading from stdin X-Git-Tag: emacs-28.0.90~6517 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9e586ac1d1b3bbabbd73a119698df742c0bfa523;p=emacs.git Signal an end-of-file error upon errors when reading from stdin * src/minibuf.c (read_minibuf_noninteractive): Signal an `end-of-file' error when reading from stdin instead of a general error (bug#34123). This makes it easier to write code that recovers from this situation. Suggested by Noam Postavsky . --- diff --git a/src/minibuf.c b/src/minibuf.c index cb302c5a605..e18ff17abbf 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -251,7 +251,7 @@ read_minibuf_noninteractive (Lisp_Object prompt, bool expflag, else { xfree (line); - error ("Error reading from stdin"); + xsignal1 (Qend_of_file, build_string ("Error reading from stdin")); } /* If Lisp form desired instead of string, parse it. */