all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>,
	michael.albinus@gmx.de, 42431@debbugs.gnu.org
Subject: bug#42431: 28.0.50; browse-url-of-dired-file confusing messaging
Date: Sun, 09 Aug 2020 11:45:05 +0200	[thread overview]
Message-ID: <87lfiow3tq.fsf@gnus.org> (raw)
In-Reply-To: <87pn80w49u.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 09 Aug 2020 11:35:25 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> It would be, but I think this points to an error in insert-file-contents
> itself.  I'll poke around some more...

Yup.  The error signalling comes from Finsert_file_contents.  If I make
this change, then the confusing messaging goes away:

diff --git a/src/fileio.c b/src/fileio.c
index 37072d9b6b..05e262b201 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -4826,7 +4826,6 @@ because (1) it preserves some marker positions and (2) it puts less data
   if (!NILP (visit) && current_buffer->modtime.tv_nsec < 0)
     {
       /* Signal an error if visiting a file that could not be opened.  */
-      report_file_errno ("Opening input file", orig_filename, save_errno);
     }
 
   /* We made a lot of deletions and insertions above, so invalidate

This was apparently introduced/changed in 2019 by this patch:

commit 3a1e7624ed234bb434cdafed59515cadd037cafa
Author:     Paul Eggert <eggert@cs.ucla.edu>
AuthorDate: Thu Oct 31 23:31:17 2019 -0700
Commit:     Paul Eggert <eggert@cs.ucla.edu>
CommitDate: Thu Oct 31 23:32:05 2019 -0700

    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.

I've Cc'd Paul on this.  Paul, the test case is:

(browse-url-of-file "/tmp/a.txt")

This will open the file correctly (via the url-file-handler file name
handler), but Emacs will then message "File exists, but cannot be read"
because Finsert_file_contents signals an error with the error message
"Success".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2020-08-09  9:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19 19:34 bug#42431: 28.0.50; browse-url-of-dired-file confusing messaging Lars Ingebrigtsen
2020-07-19 19:37 ` Lars Ingebrigtsen
2020-07-27 22:24 ` Lars Ingebrigtsen
2020-08-08  7:46   ` Eli Zaretskii
2020-08-08 10:05     ` Lars Ingebrigtsen
2020-08-08 10:22       ` Eli Zaretskii
2020-08-09  9:35         ` Lars Ingebrigtsen
2020-08-09  9:45           ` Lars Ingebrigtsen [this message]
2020-08-09 14:05             ` Eli Zaretskii
2020-08-09 14:08               ` Lars Ingebrigtsen
2022-10-13  7:00             ` Lars Ingebrigtsen
2022-10-13  8:51               ` Paul Eggert
2022-10-13 10:35                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfiow3tq.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=42431@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.