unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: michael_heerdegen@web.de, 73709@debbugs.gnu.org, drew.adams@oracle.com
Subject: bug#73709: 29.4; Doc of `file-newer-than-file-p'
Date: Thu, 10 Oct 2024 11:26:19 +0300	[thread overview]
Message-ID: <86zfnc1hzo.fsf@gnu.org> (raw)
In-Reply-To: <CADwFkmngGsD5_Ck61xmdCFptjuZvZz-=3NXyFJtCy992N2BQ4A@mail.gmail.com> (message from Stefan Kangas on Wed, 9 Oct 2024 23:42:30 +0000)

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Wed, 9 Oct 2024 23:42:30 +0000
> Cc: 73709@debbugs.gnu.org, drew.adams@oracle.com
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Are you sure this is a good idea?  If the user who reads the doc
> > string doesn't know the meaning of "the file is newer", how can we be
> > sure she knows the meaning of "file's last modification time"?
> 
> On GNU/Linux (actually POSIX) systems, we have atime/ctime/mtime.

Actually, modern Posix filesystems have much more than that.

> The word "newer" does not make it clear if we mean ctime or mtime.

Why does it matter?  Emacs Lisp programs should not care about these
details.  Emacs offers APIs that are not direct channels to calling a
Posix system call.  Emacs offers additional abstractions that are
supposed to protect the caller Lisp programs from too much low-level
and system-dependent stuff.  Seeping system-dependent details into our
documentation goes in the opposite direction.

If people want Lisp bindings of system calls, they should use Guile,
not Emacs.

> The phrasing "last modification time" makes it clear that we're talking
> about mtime.  This phrase is already used further down in (info "(elisp)
> File Attributes"), and should be equally good here.

I think you are mistaken, but let's let time judge who is right.

> > is "last modification"? does changing the file's mode bits constitute
> > "modification"? does renaming the file or moving it to another
> > directory constitute "modification"? what is the meaning of "last
> > modification time" of a directory? etc. etc. -- do we have now to
> > explain all of that in our documentation?
> 
> I don't see a need for the Elisp manual to explain these details.

Neither do I, but for different reasons.

> Users that need to know such things in detail will have to refer to
> other platform-relevant documentation, such as the POSIX standard:
> 
> https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap04.html#tag_04_12

How do we expect someone to write portable Lisp programs based on that
technobabble?

If the call to file-newer-than-file-p does not live up to its contract
in some situation or doesn't fit people's expectations that are based
on the documentation, I expect people to submit bug reports about
their expectations not being met, and demand us to fix the
implementation.  Suppose that on some filesystem FILE1 was created
after FILE2, but file-newer-than-file-p does NOT return t for FILE1.
With the previous doc string people could tell us the function was
broken in that case, whereas with the current "fixed" doc string we
could tell them that since the mtime told us FILE1 was not newer, we
are okay, and this is not a bug.  Does this sound reasonable for
Emacs?  I think not.

IOW, the addition I just made per your request breaks the (useful,
IMO) abstraction we had.  For what good reasons?





  parent reply	other threads:[~2024-10-10  8:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 17:56 bug#73709: 29.4; Doc of `file-newer-than-file-p' Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-08 18:20 ` Eli Zaretskii
2024-10-08 18:40   ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-09  0:45     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-09 13:31       ` Eli Zaretskii
2024-10-09 16:32         ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-09 23:21         ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-10  8:09           ` Eli Zaretskii
2024-10-10 11:08             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-11  0:23             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-11  5:56               ` Eli Zaretskii
2024-10-12  0:31                 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-12  8:40                   ` Eli Zaretskii
2024-10-12 22:48                     ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-13  5:13                       ` Eli Zaretskii
2024-10-13 14:51                         ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-13 15:31                           ` Eli Zaretskii
2024-10-13 17:01                             ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-13 18:30                               ` Eli Zaretskii
2024-10-13 22:23                                 ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-14  2:28                                   ` Eli Zaretskii
2024-10-15  1:10                             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-09 23:42         ` Stefan Kangas
2024-10-10  1:47           ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-10  8:26           ` Eli Zaretskii [this message]
2024-10-11  0:41             ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-11  6:03               ` Eli Zaretskii
2024-10-12  0:38                 ` Michael Heerdegen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-12  1:13                   ` Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=86zfnc1hzo.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=73709@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=michael_heerdegen@web.de \
    --cc=stefankangas@gmail.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).