unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t
@ 2017-01-17 19:43 Philipp Stephani
  2017-01-17 20:05 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Philipp Stephani @ 2017-01-17 19:43 UTC (permalink / raw)
  To: 25470


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.





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

* bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t
  2017-01-17 19:43 bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t Philipp Stephani
@ 2017-01-17 20:05 ` Eli Zaretskii
  2017-01-17 20:12 ` Eli Zaretskii
  2017-01-18 17:49 ` Eli Zaretskii
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2017-01-17 20:05 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: 25470

> From: Philipp Stephani <p.stephani2@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.





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

* bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t
  2017-01-17 19:43 bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t Philipp Stephani
  2017-01-17 20:05 ` Eli Zaretskii
@ 2017-01-17 20:12 ` Eli Zaretskii
  2017-01-18 17:49 ` Eli Zaretskii
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2017-01-17 20:12 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: 25470

> From: Philipp Stephani <p.stephani2@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.





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

* bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t
  2017-01-17 19:43 bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t Philipp Stephani
  2017-01-17 20:05 ` Eli Zaretskii
  2017-01-17 20:12 ` Eli Zaretskii
@ 2017-01-18 17:49 ` Eli Zaretskii
  2017-01-18 18:29   ` Philipp Stephani
  2017-01-18 18:34   ` Glenn Morris
  2 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2017-01-18 17:49 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: 25470

> From: Philipp Stephani <p.stephani2@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;
     }





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

* bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t
  2017-01-18 17:49 ` Eli Zaretskii
@ 2017-01-18 18:29   ` Philipp Stephani
  2017-01-18 18:37     ` Eli Zaretskii
  2017-01-18 18:34   ` Glenn Morris
  1 sibling, 1 reply; 8+ messages in thread
From: Philipp Stephani @ 2017-01-18 18:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 25470

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

Eli Zaretskii <eliz@gnu.org> schrieb am Mi., 18. Jan. 2017 um 18:50 Uhr:

> > From: Philipp Stephani <p.stephani2@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!

[-- Attachment #2: Type: text/html, Size: 1104 bytes --]

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

* bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t
  2017-01-18 17:49 ` Eli Zaretskii
  2017-01-18 18:29   ` Philipp Stephani
@ 2017-01-18 18:34   ` Glenn Morris
  2017-01-18 19:26     ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2017-01-18 18:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Philipp Stephani, 25470


Previously reported as 20659, with additional comments.





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

* bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t
  2017-01-18 18:29   ` Philipp Stephani
@ 2017-01-18 18:37     ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2017-01-18 18:37 UTC (permalink / raw)
  To: Philipp Stephani; +Cc: 25470-done

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Wed, 18 Jan 2017 18:29:06 +0000
> Cc: 25470@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.





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

* bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t
  2017-01-18 18:34   ` Glenn Morris
@ 2017-01-18 19:26     ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2017-01-18 19:26 UTC (permalink / raw)
  To: Glenn Morris; +Cc: p.stephani2, 25470

> From: Glenn Morris <rgm@gnu.org>
> Cc: Philipp Stephani <p.stephani2@gmail.com>,  25470@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).





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

end of thread, other threads:[~2017-01-18 19:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-17 19:43 bug#25470: 26.0.50; Lock files not removed when auto-save-visited-file-name is t Philipp Stephani
2017-01-17 20:05 ` Eli Zaretskii
2017-01-17 20:12 ` Eli Zaretskii
2017-01-18 17:49 ` Eli Zaretskii
2017-01-18 18:29   ` Philipp Stephani
2017-01-18 18:37     ` Eli Zaretskii
2017-01-18 18:34   ` Glenn Morris
2017-01-18 19:26     ` Eli Zaretskii

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