Subject: bug#22096: 25.0.50; reading from fifo breaks display

From: Eli Zaretskii <[email-masked]>
Date: Sat, 05 Dec 2015 18:49:39 +0200

> From: Mark Oteiza <[email-masked]>
> Date: Sat, 05 Dec 2015 11:06:22 -0500
> 
> >>      It is possible to read a special file (such as a FIFO or an I/O
> >>      device) with `insert-file-contents', as long as REPLACE and VISIT
> >>      are `nil'.
> >> 
> >> It seems this is no longer true, and we have to fix the manual to that
> >> effect.
> >
> > Or maybe that text just gets the value of VISIT wrong: the code in
> > question is very old, and always signaled an error for non-regular
> > files when VISIT is nil.
> 
> Supposedly (according to the docstring) BEG and END have to be nil if
> VISIT is t, so I should probably be getting an error about supplying
> invalid arguments.

The code explicitly doesn't:

  if (!S_ISREG (st.st_mode))
    {
      not_regular = 1;

      if (! NILP (visit))
	goto notfound;

      if (! NILP (replace) || ! NILP (beg) || ! NILP (end))
	xsignal2 (Qfile_error,
		  build_string ("not a regular file"), orig_filename);
    }

The test for VISIT non-nil, but also BEG and END non-nil is only after
that.