unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jay Berkenbilt" <ejb@ql.org>
To: "Eli Zaretskii" <eliz@gnu.org>, "Glenn Morris" <rgm@gnu.org>,
	"Michael Albinus" <michael.albinus@gmx.de>,
	"Lars Ingebrigtsen" <larsi@gnus.org>
Cc: 53207@debbugs.gnu.org
Subject: bug#53207: 28.0.91; create-lockfiles nil breaks file change detection
Date: Thu, 13 Jan 2022 08:11:34 -0500	[thread overview]
Message-ID: <df3d43c9-31ba-442b-b694-f86fcccb2726@www.fastmail.com> (raw)
In-Reply-To: <83sftr3nyx.fsf@gnu.org>



On Thu, Jan 13, 2022, at 5:54 AM, Eli Zaretskii wrote:
> > From: Glenn Morris <rgm@gnu.org>
> > Date: Wed, 12 Jan 2022 13:13:40 -0500
> > Cc: michael.albinus@gmx.de, 53207@debbugs.gnu.org
> > 
> > Probably a consequence of 9ce6541ac9, specifically:
> > 
> >   * src/filelock.c (lock_file): Don't check create_lockfiles.
> 
> Actually, the more relevant part is this:
> 
>     (Flock_file): Check create_lockfiles.
> 
> which did
> 
>   -  CHECK_STRING (file);
>   -  lock_file (file);
>   +#ifndef MSDOS
>   +  /* Don't do locking if the user has opted out.  */
>   +  if (create_lockfiles)
>   +    {
>   +      CHECK_STRING (file);
>   +      lock_file (file);
>   +    }
>   +#endif /* MSDOS */
> 
> > which would seem to mean that ask-user-about-supersession-threat
> > is no longer called when create-lockfiles is nil.
> > Was this intentional?
> 
> Michael, can you please chime in?  The long discussion we had back
> then doesn't seem to mention this aspect, or maybe I'm missing
> something?
> 
> We should either document this change (if we think what we have now is
> the intended behavior), or we should move the call to
> userlock--ask-user-about-supersession-threat into Flock_file if it's
> unintended.
> 
> Personally, I prefer the former, since lock_file accesses the lock
> file, which doesn't make a lot of sense if the user opted out of the
> feature.  But that's me.

For my edification, can you explain how the 27.2 behavior of noticing
when a file's contents had changed immediately is not adequate without
lockfiles? Is it that it doesn't work on some platforms, it doesn't
work reliably with a network file system, etc.?

It seems to me that there are two separate issues here. A lock file
would enable you to immediately notice if a user on a *different
system* is in the process of editing a file and has unsaved changes.
On the other hand, the other behavior I'm talking about allows you to
notice immediately when you begin editing if the file on disk has
become out of sync with the buffer contents. These seem like two
different things, both of which are valuable. I can't see how you
would ever want to disable noticing if the file's contents on disk
differ from the buffer, but if you never edit files with emacs on a
multi-user system, then I don't see why you would care about
lockfiles.

All that said, I'm perfectly happy for my own purposes to set
lock-file-name-transforms...I'm just trying to contribute a fresh,
outside perspective (from someone who has used emacs for over 30
years and has a made a career of software development, including open
source software) to the discussion.

I trust that everyone is aware of the issue and will come to a good
resolution. Thanks! I'm eager to hear the other opinions, even though
I have no "vote" in the outcome.





  reply	other threads:[~2022-01-13 13:11 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12 14:30 bug#53207: 28.0.91; create-lockfiles nil breaks file change detection Jay Berkenbilt
2022-01-12 17:26 ` Eli Zaretskii
2022-01-12 20:07   ` Jay Berkenbilt
2022-01-12 20:45     ` Eli Zaretskii
2022-01-12 21:35       ` Jay Berkenbilt
2022-01-13  6:43         ` Eli Zaretskii
2022-01-13 13:06           ` Jay Berkenbilt
2022-01-12 18:13 ` Glenn Morris
2022-01-12 18:41   ` Philipp Stephani
2022-01-13 10:54   ` Eli Zaretskii
2022-01-13 13:11     ` Jay Berkenbilt [this message]
2022-01-13 13:24       ` Philipp Stephani
2022-01-13 14:02       ` Eli Zaretskii
2022-01-13 15:47         ` Jay Berkenbilt
2022-01-14 14:26           ` Michael Albinus
2022-01-14 14:43             ` Eli Zaretskii
2022-01-14 16:11             ` Glenn Morris
2022-01-14 16:44               ` Eli Zaretskii
2022-01-15  8:06               ` Lars Ingebrigtsen
2022-01-15  8:16                 ` Lars Ingebrigtsen
2022-01-15  9:23                 ` Eli Zaretskii
2022-01-27 17:19                   ` Eli Zaretskii
2022-01-28 13:42                     ` Lars Ingebrigtsen
2022-01-28 14:30                       ` Eli Zaretskii
2022-01-28 14:56                         ` Michael Albinus
2022-01-28 15:16                           ` Eli Zaretskii
2022-01-29 10:53                             ` Michael Albinus
2022-01-29 10:57                               ` Eli Zaretskii
2022-02-03 13:31                                 ` Michael Albinus

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=df3d43c9-31ba-442b-b694-f86fcccb2726@www.fastmail.com \
    --to=ejb@ql.org \
    --cc=53207@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=michael.albinus@gmx.de \
    --cc=rgm@gnu.org \
    /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).