unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53207: 28.0.91; create-lockfiles nil breaks file change detection
@ 2022-01-12 14:30 Jay Berkenbilt
  2022-01-12 17:26 ` Eli Zaretskii
  2022-01-12 18:13 ` Glenn Morris
  0 siblings, 2 replies; 29+ messages in thread
From: Jay Berkenbilt @ 2022-01-12 14:30 UTC (permalink / raw)
  To: 53207

 X-Debbugs-CC: ejb@ql.org

This bug is reproducible with emacs -Q.

emacs 28.0.91 and emacs-27.2, with -Q, behave identically and correctly in the following scenario:

* outside of emacs: rm /tmp/a; echo one > /tmp/a
* In a fresh emacs -Q, C-x C-f /tmp/a
* outside of emacs: touch /tmp/a
* In /tmp/a in emacs, it is possible to edit the file freely and save, which is correct since the contents have not changed
* In /tmp/a in emacs, save any changes
* outside of emacs: echo test >> /tmp/a
* In /tmp/a in emacs: try editing and get an immediate prompt that the file has changed.

With emacs 27.2, (setq create-lockfiles nil) does not change the above behavior.

With emacs 28.0.91, (setq create-lockfiles nil) results in the following changes in behavior:

* outside of emacs: rm /tmp/a; echo one > /tmp/a
* In a fresh emacs -Q, C-x C-f /tmp/a
* outside of emacs: touch /tmp/a
* In /tmp/a in emacs, it is possible to edit the file freely, but **SAVING THE FILE RESULTS IN A PROMPT** (a has changed since visited or saved...) even though the *contents* of the file have not changed (only its modification time)
  * Say no to the prompt and M-x revert-buffer, accepting the prompt to revert the modified buffer
* outside of emacs: echo test >> /tmp/a
* In /tmp/a in emacs: try editing. **NO PROMPT IS GIVEN; EDITING CAN BE DONE FREELY**
* Try to save the file. Get the "a has changed since visited or saved" prompt at this time

Bottom line: in emacs 27.2, setting create-lockfiles to nil does not change the behavior. In emacs 28.0.91, it does. I also noticed this in 28.0.90 but hadn't had time to figure out how to reproduce it without my customizations.

I saw 'lock-file-name-transforms' in NEWS. I disable create-lockfiles because I never run emacs on a multi-user system with my default settings, and the dangling symlinks confuse too many systems. It may be that, if emacs-major-version is >= 28, I can use lock-file-name-transforms to cause lock files to save in a separate directory, but I find that I don't need lockfiles at all with the default behavior of emacs 27 and 28 regarding change detection, at least my on Ubuntu platform. 

Is this change intentional? If so, can I configure something to go back to the old behavior? It seems like a bug to me -- I don't see why create-lockfiles should have anything to do with this behavior, and it did not in 27.2. I've been running gnu emacs since version 18 in 1987 and have seen the evolution of lock files over time. I was euphoric when emacs started being able to notice when an update to a file's modification time didn't change its contents. It makes it so much easier to do things like git rebase, which I do many times a day. Thanks.

The text below came from M-x report-emacs-bug on emacs-28.0.91 -Q

In GNU Emacs 28.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
of 2022-01-12 built on jblin
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.3 LTS

Configured using:
'configure --prefix=/usr/local/emacs-28.0.91'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 51426 5400)
(symbols 48 6608 1)
(strings 32 18372 1964)
(string-bytes 1 610917)
(vectors 16 14475)
(vector-slots 8 191331 9434)
(floats 8 21 35)
(intervals 56 200 0)
(buffers 992 10))





^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2022-02-03 13:31 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).