Subject: Re: 27.0.50; File error regression
From: Paul Eggert <[email-masked]>
To: Juri Linkov <[email-masked]>
Cc: [email-masked]
Date: Thu, 31 Oct 2019 23:39:07 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks for the bug report. That one's my fault, as it was due to this patch:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=ba0605779e0e207161441c08afdfac57ed603f69

which fixed a problem elsewhere but introduced a bug. I installed the attached 
patch to fix things.
From 3a1e7624ed234bb434cdafed59515cadd037cafa Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Thu, 31 Oct 2019 23:31:17 -0700
Subject: [PATCH] Fix insert-file-contents file error regression

Problem reported for dired-view-file (Bug#37950).
* src/fileio.c (Finsert_file_contents): When visiting,
signal an error if the file could not be opened for any reason,
rather than signaling an error only for nonexistent files, fixing
a bug introduced in 2019-09-16T03:17:[email-masked].
---
 src/fileio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/fileio.c b/src/fileio.c
index a3121a26da..01f8a04e5d 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4806,10 +4806,9 @@ by calling `format-decode', which see.  */)
       unbind_to (count1, Qnil);
     }
 
-  if (!NILP (visit)
-      && current_buffer->modtime.tv_nsec == NONEXISTENT_MODTIME_NSECS)
+  if (!NILP (visit) && current_buffer->modtime.tv_nsec < 0)
     {
-      /* If visiting nonexistent file, return nil.  */
+      /* Signal an error if visiting a file that could not be opened.  */
       report_file_errno ("Opening input file", orig_filename, save_errno);
     }
 
-- 
2.17.1