unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37950: 27.0.50; File error regression
@ 2019-10-27 22:50 Juri Linkov
  2019-11-01  6:39 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Juri Linkov @ 2019-10-27 22:50 UTC (permalink / raw)
  To: 37950

0. emacs -Q

1. in Dired type 'v' ('dired-view-file') to view a read-protected file, e.g.
   from non-root to visit a file with such permissions: -rw------- root root

2. Empty buffer is displayed (but the file size is several kilobytes)

3. The echo area displays the message:

   View mode: type C-h for help, h for commands, q to quit.

4. Visiting *Messages* reveals the error message:

   Note: file is write protected

obscured by the View mode message above.

But this error message is wrong anyway.  In previous versions
the error message was correct:

    find-file-noselect-1: File is not readable:

and it rightfully refused to visit the read-protected file.


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-10-27 built on localhost
Repository revision: c6667cc6a958e06fd43fb1ee0e80753adfefa49d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Linux Mint 19

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Note: file is write protected
View mode: type C-h for help, h for commands, q to quit.

Configured using:
 'configure --with-x-toolkit=gtk3 --with-xwidgets --with-xft
 --with-modules --enable-checking=yes,glyphs
 --enable-check-lisp-object-type 'CFLAGS=-O0 -g3 -gdwarf-4''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY
GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS PDUMPER
LCMS2 GMP

Important settings:
  value of $LC_MONETARY: et_EE.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_DK.utf8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#37950: 27.0.50; File error regression
  2019-10-27 22:50 bug#37950: 27.0.50; File error regression Juri Linkov
@ 2019-11-01  6:39 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2019-11-01  6:39 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 37950-done

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

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.

[-- Attachment #2: 0001-Fix-insert-file-contents-file-error-regression.patch --]
[-- Type: text/x-patch, Size: 1199 bytes --]

From 3a1e7624ed234bb434cdafed59515cadd037cafa Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
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:43!eggert@cs.ucla.edu.
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-01  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-27 22:50 bug#37950: 27.0.50; File error regression Juri Linkov
2019-11-01  6:39 ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).