bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53207: 28.0.91; create-lockfiles nil breaks file change detection


From: Jay Berkenbilt
Subject: bug#53207: 28.0.91; create-lockfiles nil breaks file change detection
Date: Thu, 13 Jan 2022 08:06:24 -0500
User-agent: Cyrus-JMAP/3.5.0-alpha0-4569-g891f756243-fm-20220111.001-g891f7562


On Thu, Jan 13, 2022, at 1:43 AM, Eli Zaretskii wrote:
> > Date: Wed, 12 Jan 2022 16:35:15 -0500
> > From: "Jay Berkenbilt" <ejb@ql.org>
> > Cc: 53207@debbugs.gnu.org
> > 
> > > > > My suggestion is to stop setting create-lockfiles to a nil value.  Why
> > > > > is the non-nil value a problem?
> > > > 
> > > > Emacs lockfiles are dangling symbolic links. Some tools and systems 
> > > > don't
> > > > like those.
> > > 
> > > Isn't that the reason we introduced lock-file-name-transforms?
> > 
> > Perhaps so, but this misses the point.
> 
> My point was to say that if you want collision detection, you should
> turn on create-lockfiles.  You said this could cause problems with
> some tools, and I then pointed out that Emacs 28 has a new feature to
> help you solve that side effect, so that you could use locking again.

Thank you for clarifying.

I have added the following to emacs initialization code. This is satisfying my
need to avoid dangling links in places that confuse tools.

=== 8< ===
  ;; I never use emacs with my own configuration in a multi-user
  ;; environment, and lockfiles are dangling links that confuse some
  ;; tools. Conflict detection works prior to 28.1 with
  ;; create-lockfiles nil. Starting in 28.1, it no longer works with
  ;; create-lockfiles nil, but lock-file-name-transforms can be used
  ;; to create the dangling links somewhere else. See
  ;; http://debbugs.gnu.org/cgi/bugreport.cgi?bug=53207
  (if (boundp 'lock-file-name-transforms)
      (let* ((lockdir (expand-file-name "~/.emacs.d/lockfiles"))
             (replacement (concat lockdir "/\\2")))
        (make-directory lockdir t)
        (setq lock-file-name-transforms
              `(("\\`\\([^/]*/\\)*\\([^/]*\\)\\'" ,replacement t))
        )
      )
    (setq create-lockfiles nil)
  )
=== 8< ===


> > It just seems strange that emacs is perfectly capable of detecting when a 
> > file was changed
> > outside of emacs without a lockfile but doesn't do this check if it's not 
> > also creating lockfiles.
> 
> Once again, this is not about the lockfiles, this is about the entire
> feature of detection of editing collisions.  The variable's name is a
> misnomer.

In addition to any other doc clarifications, I'd suggest the fact that 
create-lockfiles is a misnomer
be explained in the help for create-lockfiles.

I will add some thoughts to a different part of the thread. Thanks!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]