unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Boruch Baum <boruch_baum@gmx.com>
Cc: 34338@debbugs.gnu.org
Subject: bug#34338: 26.1; delete-file return codes and failures
Date: Wed, 30 Oct 2019 23:52:50 +0100	[thread overview]
Message-ID: <875zk5x2v1.fsf@joffe.skangas.se> (raw)
In-Reply-To: <20191030222159.rwfn7clgfjh36dze@E15-2016.optimum.net> (Boruch Baum's message of "Wed, 30 Oct 2019 18:22:00 -0400")

Boruch Baum <boruch_baum@gmx.com> writes:

> How is it backwards incompatable? If the prior behavior was undefined,
> no one would have been using it for anything. From their perspective, a
> defined is just another form of undefined behavior, if you get my drift.

Having re-read the entire discussion, I think that we should perhaps
clarify what we're talking about.  Your proposal had three different
parts to it AFAICT:

Boruch Baum <boruch_baum@gmx.com> writes:

> B1) return t on success

Eli said that: "The function's return value is not documented, which is
an indication that it is 'not useful'."

Do you have a use-case in mind here?  Can't the caller just check using
'file-exists-p' if it matters instead?

> B2) raise an error when (not NOERROR) and:
> 
>   B2.1) file doesn't exist
> 
>   B2.2) (and (chmod -w) (not FORCE))
> 
>   B2.3) another form of permission denial is encountered

Eli replied: "In any case, you propose a backward-incompatible change in
behavior, so it won't fly.  We could perhaps do it the other way around:
add a new optional argument ERROR-OUT, which, when non-nil, will cause
the function to signal an error when B2.1 or B2.2 happen (I believe B2.3
already causes an error).  And similarly with FORCE."

I'm not against this part, but again I'm not sure what is the use-case
here.  And what about having the caller use 'file-exists-p' instead?

> B3) return nil when NOERROR and:
> 
>   B2.1) file doesn't exist
> 
>   B2.2)  another form of permission denial is encountered

I guess the inverted version of the above makes sense (return nil unless
ERROR-OUT), iff we add B1 and B2.

> C) maybe log the exact error or reason for nil to *Messages*.

This part was agreed to be left out already, and I agree.

Best regards,
Stefan Kangas





  reply	other threads:[~2019-10-30 22:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 21:47 bug#34338: 26.1; delete-file return codes and failures Boruch Baum
2019-02-06  8:24 ` Michael Albinus
2019-02-06  9:35   ` Boruch Baum
2019-02-06 16:19 ` Eli Zaretskii
2019-02-06 21:02   ` Boruch Baum
2019-02-07  3:36     ` Eli Zaretskii
2019-02-07  5:14       ` Boruch Baum
2019-10-09 11:48 ` Stefan Kangas
2019-10-30 21:07   ` Stefan Kangas
2019-10-30 22:22     ` Boruch Baum
2019-10-30 22:52       ` Stefan Kangas [this message]
2019-10-31  1:33         ` Boruch Baum
2019-10-31 14:32           ` Eli Zaretskii
2019-11-01  9:34             ` Boruch Baum
2019-11-01  9:55               ` Eli Zaretskii
2019-11-08 13:00           ` Stefan Kangas
2019-10-31 14:01       ` 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

  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=875zk5x2v1.fsf@joffe.skangas.se \
    --to=stefan@marxist.se \
    --cc=34338@debbugs.gnu.org \
    --cc=boruch_baum@gmx.com \
    /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).