all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Uday S Reddy <u.s.reddy@cs.bham.ac.uk>
Cc: 5314@debbugs.gnu.org
Subject: bug#5314: Acknowledgement (23.1; Inconsistent treatment of auto-save files)
Date: Wed, 06 Jan 2010 11:08:43 -0500	[thread overview]
Message-ID: <jwv3a2jfctx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <19267.19658.406000.307675@gargle.gargle.HOWL> (Uday S. Reddy's message of "Tue, 5 Jan 2010 14:29:30 +0000")

> The following sequence seems to always return t
>   (progn (set-buffer-modified-p t) (recent-auto-save-p))

Yes, that's a problem.  Thanks for tracking it down.  I'm looking at the
corresponding code and see from where the problem comes.

I should have a patch for it shortly.  It's kind of a delicate issue
because both the buffer-modified-p data as well as the
recent-auto-save-p data are kept implicitly, basically by checking
timestamps corresponding to the last (auto)save.  That means that
set-buffer-modified-p has to fiddle with those timestamps and lie about
"when" the save took place.  And since there are several such timestamps
involved, a lie at one place can result in odd behaviors elsewhere, as
you're seeing.

> VM's quit routine had the following series of operations:

>       (set-buffer-modified-p nil)
>       (delete-auto-save-file-if-necessary)
>       (kill-buffer (current-buffer)))

> This might have worked in some old version of Emacs.  But, at present,
> the delete-..-if-necessary doesn't do anything because the buffer has
> been set to be unmodified.  (This is reasonable behaviour for the
> delete-..-if-necessary function, but it doesn't follow from the
> documented description of it.)

Indeed delete-auto-save-file-if-necessary claims that it only deletes it
"if the file was written by this Emacs since the last real save", but in
reality (set-buffer-modified-p nil) is mistaken for a "real save"
(because it internally works by setting the "last save timestamp").

A real good fix to make it work reliably and obey the doc may take time.


        Stefan






  parent reply	other threads:[~2010-01-06 16:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-04 15:47 bug#5314: 23.1; Inconsistent treatment of auto-save files Uday S Reddy
     [not found] ` <handler.5314.B.126270052714260.ack@debbugs.gnu.org>
2010-01-05 14:29   ` bug#5314: Acknowledgement (23.1; Inconsistent treatment of auto-save files) Uday S Reddy
2010-01-06  6:29     ` Kevin Rodgers
2010-01-06 16:08     ` Stefan Monnier [this message]
2010-01-06 16:33       ` Uday S Reddy
2016-07-17  4:29         ` Andrew Hyatt
2010-01-05 19:28 ` bug#5314: 23.1; Inconsistent treatment of auto-save files Stefan Monnier
2010-01-06  2:14   ` Uday S Reddy

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv3a2jfctx.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=5314@debbugs.gnu.org \
    --cc=u.s.reddy@cs.bham.ac.uk \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.