Subject: bug#42431: 28.0.50; browse-url-of-dired-file confusing messaging

From: Paul Eggert <[email-masked]>
Date: Thu, 13 Oct 2022 01:51:00 -0700

On 2022-10-13 00:00, Lars Ingebrigtsen wrote:

> I've now fixed this in Emacs 29.

Thanks, I simplified the fileio.c fix by installing the attached further 
patch.

From 97de273dca8d97039131f9d3f29b2820b5497805 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email-masked]>
Date: Thu, 13 Oct 2022 01:48:10 -0700
Subject: [PATCH] Simplify recent "File exists" fix

* src/fileio.c (Finsert_file_contents):
Simplify previous change that fixed bug#42431.
---
 src/fileio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fileio.c b/src/fileio.c
index a238889803..49553f3c91 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5000,7 +5000,7 @@ because (1) it preserves some marker positions (in unchanged portions
       unbind_to (count1, Qnil);
     }
 
-  if (NILP (handler) && !NILP (visit) && current_buffer->modtime.tv_nsec < 0)
+  if (save_errno != 0)
     {
       /* Signal an error if visiting a file that could not be opened.  */
       report_file_errno ("Opening input file", orig_filename, save_errno);
-- 
2.34.1