unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Emacs-devel@gnu.org
Subject: Re: Improve reporting of I/O, access errors for Emacs
Date: Thu, 12 Sep 2019 22:34:58 +0300	[thread overview]
Message-ID: <83a7b91f6l.fsf@gnu.org> (raw)
In-Reply-To: <dd4aba08-a6e6-4c40-75a8-2de858fcee61@cs.ucla.edu> (message from Paul Eggert on Thu, 12 Sep 2019 11:27:28 -0700)

> Cc: Emacs-devel@gnu.org
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Thu, 12 Sep 2019 11:27:28 -0700
> 
> On 9/12/19 11:04 AM, Eli Zaretskii wrote:
> > We should instead have such logic on higher levels, where the
> > semantics and the meaning of errors are clear.
> 
> If lower levels suppress the info, logic on higher levels cannot obtain 
> the information and therefore cannot deal with the errors. So there must 
> be some change to the lower levels, regardless of what changes might be 
> advisable at higher levels.

I wasn't questioning changes on lower levels, I was questioning
signaling errors there.

> > if Emacs just needs
> > to return some information about a file, and the file turns out to be
> > inaccessible, why do we need to signal an error
> 
> The same reason insert-file-contents signals an error when a file is 
> inaccessible: the requested information is not available, and this is an 
> exceptional condition.

The analogy is incorrect: insert-file-contents is the level where I
think we can signal errors, because that level knows what these errors
mean from the application point of view: the application wanted to
have a file in a buffer, but that couldn't be done.  Same with
copy-file, delete-file, etc.

But your changes signal errors from stuff like emacs_readlinkat,
file_name_case_insensitive_p, and file_directory_p.  On that level, we
have no idea whether an error is critical or not.  We should just set
errno and return an error indication, and then let the caller deal
with that.

> I should mention that I've been trying out the new code and it works 
> fine for me.

That's too small a sample, so it doesn't prove much in my book, sorry.



  reply	other threads:[~2019-09-12 19:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  8:22 Improve reporting of I/O, access errors for Emacs Paul Eggert
2019-09-12 18:04 ` Eli Zaretskii
2019-09-12 18:27   ` Paul Eggert
2019-09-12 19:34     ` Eli Zaretskii [this message]
2019-09-12 20:32       ` Paul Eggert
2019-09-13  7:37         ` Eli Zaretskii
2019-09-18  2:25           ` Paul Eggert
2019-09-18  9:50             ` Richard Copley
2019-09-16 11:07 ` Richard Copley
2019-09-16 14:53   ` Eli Zaretskii
2019-09-16 18:11     ` Richard Copley

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83a7b91f6l.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=Emacs-devel@gnu.org \
    --cc=eggert@cs.ucla.edu \
    /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 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).