GNU bug report logs - #25470
26.0.50; Lock files not removed when auto-save-visited-file-name is t

Previous Next

Package: emacs;

Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>

Date: Tue, 17 Jan 2017 19:44:01 UTC

Severity: normal

Found in version 26.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25470 in the body.
You can then email your comments to 25470 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25470; Package emacs. (Tue, 17 Jan 2017 19:44:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philipp Stephani <p.stephani2 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 17 Jan 2017 19:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Lock files not removed when auto-save-visited-file-name is t
Date: Tue, 17 Jan 2017 20:43:33 +0100
Customize auto-save-visited-file to t, then edit a buffer and wait until
it's auto-saved.  Even after auto-saving the lock file (.#) is still
present.  It should be removed after a successful auto-save.


In GNU Emacs 26.0.50.36 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2017-01-17 built on localhost
Repository revision: fd8196503247a4577a422475c6b8552b0ef4068e
Windowing system distributor 'The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04 LTS

Recent messages:
Auto-saving...done
mwheel-scroll: Beginning of buffer
Mark set
Setting ‘send-mail-function’ temporarily since "emacs -q" would overwrite customizations
Sending...
Mark set [2 times]
Sending via mail...
Sending email 
Sending email done
Sending...done

Configured using:
 'configure --with-modules --enable-checking
 --enable-check-lisp-object-type 'CFLAGS=-ggdb3 -O0''

Configured features:
XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

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
  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
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(network-stream nsm starttls tls gnutls mailalias smtpmail auth-source
cl-seq eieio eieio-core cl-macs eieio-loaddefs qp cus-edit cus-start
cus-load wid-edit pp shadow sort mail-extr emacsbug message subr-x puny
seq byte-opt gv bytecomp byte-compile cl-extra help-mode cconv
cl-loaddefs pcase cl-lib dired dired-loaddefs format-spec rfc822 mml
easymenu mml-sec password-cache epa derived epg epg-config gnus-util
rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type 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 elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame 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 charscript case-table epa-hook jka-cmpr-hook help
simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button
faces cus-face macroexp files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote inotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 125814 13101)
 (symbols 48 22408 9)
 (miscs 40 368 355)
 (strings 32 23672 8661)
 (string-bytes 1 750736)
 (vectors 16 22890)
 (vector-slots 8 1256395 205395)
 (floats 8 225 207)
 (intervals 56 505 23)
 (buffers 976 16)
 (heap 1024 46632 5565))

-- 
Google Germany GmbH
Erika-Mann-Straße 33
80636 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

Diese E-Mail ist vertraulich.  Wenn Sie nicht der richtige Adressat sind,
leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen
Sie die E-Mail und alle Anhänge.  Vielen Dank.

This e-mail is confidential.  If you are not the right addressee please do not
forward it, please inform the sender, and please erase this e-mail including
any attachments.  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25470; Package emacs. (Tue, 17 Jan 2017 20:21:03 GMT) Full text and rfc822 format available.

Message #8 received at 25470 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 25470 <at> debbugs.gnu.org
Subject: Re: bug#25470: 26.0.50;
 Lock files not removed when auto-save-visited-file-name is t
Date: Tue, 17 Jan 2017 22:12:48 +0200
> From: Philipp Stephani <p.stephani2 <at> gmail.com>
> Date: Tue, 17 Jan 2017 20:43:33 +0100
> 
> Customize auto-save-visited-file to t, then edit a buffer and wait until
> it's auto-saved.  Even after auto-saving the lock file (.#) is still
> present.  It should be removed after a successful auto-save.

Please disregard my previous response.  I see that we clear the
buffer's modified status when we auto-save in this case, so yes, we
should also unlock the buffer's visited file.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25470; Package emacs. (Tue, 17 Jan 2017 20:21:04 GMT) Full text and rfc822 format available.

Message #11 received at 25470 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 25470 <at> debbugs.gnu.org
Subject: Re: bug#25470: 26.0.50;
 Lock files not removed when auto-save-visited-file-name is t
Date: Tue, 17 Jan 2017 22:05:09 +0200
> From: Philipp Stephani <p.stephani2 <at> gmail.com>
> Date: Tue, 17 Jan 2017 20:43:33 +0100
> 
> Customize auto-save-visited-file to t, then edit a buffer and wait until
> it's auto-saved.  Even after auto-saving the lock file (.#) is still
> present.  It should be removed after a successful auto-save.

No, we remove the lock only after the file is saved.  This is not a
bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25470; Package emacs. (Wed, 18 Jan 2017 17:51:02 GMT) Full text and rfc822 format available.

Message #14 received at 25470 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 25470 <at> debbugs.gnu.org
Subject: Re: bug#25470: 26.0.50;
 Lock files not removed when auto-save-visited-file-name is t
Date: Wed, 18 Jan 2017 19:49:53 +0200
> From: Philipp Stephani <p.stephani2 <at> gmail.com>
> Date: Tue, 17 Jan 2017 20:43:33 +0100
> 
> 
> Customize auto-save-visited-file to t, then edit a buffer and wait until
> it's auto-saved.  Even after auto-saving the lock file (.#) is still
> present.  It should be removed after a successful auto-save.

Does the patch below give good results?

diff --git a/src/fileio.c b/src/fileio.c
index be52d0f..8c8cba9 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5142,19 +5142,26 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename,
   if (! ok)
     report_file_errno ("Write error", filename, save_errno);
 
+  bool auto_saving_into_visited_file =
+    auto_saving
+    && ! NILP (Fstring_equal (BVAR (current_buffer, filename),
+			      BVAR (current_buffer, auto_save_file_name)));
   if (visiting)
     {
       SAVE_MODIFF = MODIFF;
       XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
       bset_filename (current_buffer, visit_file);
       update_mode_lines = 14;
+      if (auto_saving_into_visited_file)
+	unlock_file (lockname);
     }
   else if (quietly)
     {
-      if (auto_saving
-	  && ! NILP (Fstring_equal (BVAR (current_buffer, filename),
-				    BVAR (current_buffer, auto_save_file_name))))
-	SAVE_MODIFF = MODIFF;
+      if (auto_saving_into_visited_file)
+	{
+	  SAVE_MODIFF = MODIFF;
+	  unlock_file (lockname);
+	}
 
       return Qnil;
     }




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25470; Package emacs. (Wed, 18 Jan 2017 18:30:02 GMT) Full text and rfc822 format available.

Message #17 received at 25470 <at> debbugs.gnu.org (full text, mbox):

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 25470 <at> debbugs.gnu.org
Subject: Re: bug#25470: 26.0.50; Lock files not removed when
 auto-save-visited-file-name is t
Date: Wed, 18 Jan 2017 18:29:06 +0000
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> schrieb am Mi., 18. Jan. 2017 um 18:50 Uhr:

> > From: Philipp Stephani <p.stephani2 <at> gmail.com>
> > Date: Tue, 17 Jan 2017 20:43:33 +0100
> >
> >
> > Customize auto-save-visited-file to t, then edit a buffer and wait until
> > it's auto-saved.  Even after auto-saving the lock file (.#) is still
> > present.  It should be removed after a successful auto-save.
>
> Does the patch below give good results?
>
>
I haven't tested it extensively, but it appears to work as desired. Thanks!
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25470; Package emacs. (Wed, 18 Jan 2017 18:35:01 GMT) Full text and rfc822 format available.

Message #20 received at 25470 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Philipp Stephani <p.stephani2 <at> gmail.com>, 25470 <at> debbugs.gnu.org
Subject: Re: bug#25470: 26.0.50;
 Lock files not removed when auto-save-visited-file-name is t
Date: Wed, 18 Jan 2017 13:34:45 -0500
Previously reported as 20659, with additional comments.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Wed, 18 Jan 2017 18:39:02 GMT) Full text and rfc822 format available.

Notification sent to Philipp Stephani <p.stephani2 <at> gmail.com>:
bug acknowledged by developer. (Wed, 18 Jan 2017 18:39:02 GMT) Full text and rfc822 format available.

Message #25 received at 25470-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 25470-done <at> debbugs.gnu.org
Subject: Re: bug#25470: 26.0.50; Lock files not removed when
 auto-save-visited-file-name is t
Date: Wed, 18 Jan 2017 20:37:55 +0200
> From: Philipp Stephani <p.stephani2 <at> gmail.com>
> Date: Wed, 18 Jan 2017 18:29:06 +0000
> Cc: 25470 <at> debbugs.gnu.org
> 
>  > Customize auto-save-visited-file to t, then edit a buffer and wait until
>  > it's auto-saved. Even after auto-saving the lock file (.#) is still
>  > present. It should be removed after a successful auto-save.
> 
>  Does the patch below give good results?
> 
> I haven't tested it extensively, but it appears to work as desired. Thanks! 

Thanks for testing, I pushed this to master, and I'm marking this bug
done.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25470; Package emacs. (Wed, 18 Jan 2017 19:27:01 GMT) Full text and rfc822 format available.

Message #28 received at 25470 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: p.stephani2 <at> gmail.com, 25470 <at> debbugs.gnu.org
Subject: Re: bug#25470: 26.0.50;
 Lock files not removed when auto-save-visited-file-name is t
Date: Wed, 18 Jan 2017 21:26:17 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: Philipp Stephani <p.stephani2 <at> gmail.com>,  25470 <at> debbugs.gnu.org
> Date: Wed, 18 Jan 2017 13:34:45 -0500
> 
> 
> Previously reported as 20659, with additional comments.

The additional comments describe an entirely different issue, but I
cannot reproduce it (or maybe I don't understand the description).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 16 Feb 2017 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 128 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.