GNU bug report logs - #8891
23.3; save-buffer messages about writing files that may not be written

Previous Next

Package: emacs;

Reported by: Dave Abrahams <dave <at> boostpro.com>

Date: Sat, 18 Jun 2011 16:51:02 UTC

Severity: minor

Found in version 23.3

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


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

From: Dave Abrahams <dave <at> boostpro.com>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: 8891 <at> debbugs.gnu.org
Subject: Re: 23.3;
	save-buffer messages about writing files that may not be written
Date: Sun, 03 Jul 2011 16:26:28 -0400
on Sun Jul 03 2011, Lars Magne Ingebrigtsen <larsi-AT-gnus.org> wrote:

> Dave Abrahams <dave <at> boostpro.com> writes:
>
>> I have hooked write-file-functions for certain files to check the md5
>> sum of the file against what it was when last saved and simply mark the
>> file unmodified
>> (https://github.com/dabrahams/initsplit/blob/master/initsplit.el#L300)
>>
>> However, I get a message about saving these files even when there's been
>> no modification.  I think these lines in save-buffer come too early:
>>
>>     (if (and modp (buffer-file-name))
>> 	(message "Saving file %s..." (buffer-file-name)))
>
> Hm.  If `modp' is true, then the buffer has been modified, hasn't it?

Yes... until `save-buffer' calls `basic-save-buffer' which invokes
`write-file-functions', one of which decides to override the notion of
"modified-ness" when it ascertains that the contents have not actually
changed.  So modp tells the truth at the time it's checked, but IMO it's
checked too early.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




This bug report was last modified 13 years and 344 days ago.

Previous Next


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