From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dave Abrahams Newsgroups: gmane.emacs.bugs Subject: bug#8891: 23.3; save-buffer messages about writing files that may not be written Date: Sun, 03 Jul 2011 16:26:28 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1309724854 13789 80.91.229.12 (3 Jul 2011 20:27:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 3 Jul 2011 20:27:34 +0000 (UTC) Cc: 8891@debbugs.gnu.org To: Lars Magne Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 03 22:27:30 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QdTGL-0000kb-0A for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Jul 2011 22:27:29 +0200 Original-Received: from localhost ([::1]:41342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdTGK-0005io-2K for geb-bug-gnu-emacs@m.gmane.org; Sun, 03 Jul 2011 16:27:28 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:39855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdTFx-0005iC-Oq for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2011 16:27:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdTFv-0007wR-J5 for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2011 16:27:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdTFv-0007wN-80 for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2011 16:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QdTFu-0008UT-8b; Sun, 03 Jul 2011 16:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dave Abrahams Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Jul 2011 20:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8891 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8891-submit@debbugs.gnu.org id=B8891.130972480032606 (code B ref 8891); Sun, 03 Jul 2011 20:27:02 +0000 Original-Received: (at 8891) by debbugs.gnu.org; 3 Jul 2011 20:26:40 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QdTFX-0008Tr-Eq for submit@debbugs.gnu.org; Sun, 03 Jul 2011 16:26:39 -0400 Original-Received: from mail-qw0-f44.google.com ([209.85.216.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QdTFV-0008Tf-C3 for 8891@debbugs.gnu.org; Sun, 03 Jul 2011 16:26:38 -0400 Original-Received: by qwc23 with SMTP id 23so2296717qwc.3 for <8891@debbugs.gnu.org>; Sun, 03 Jul 2011 13:26:31 -0700 (PDT) Original-Received: by 10.224.27.20 with SMTP id g20mr4350438qac.178.1309724791774; Sun, 03 Jul 2011 13:26:31 -0700 (PDT) Original-Received: from pluto.luannocracy.com (207-172-223-249.c3-0.smr-ubr3.sbo-smr.ma.static.cable.rcn.com [207.172.223.249]) by mx.google.com with ESMTPS id m31sm1502452qck.13.2011.07.03.13.26.30 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 03 Jul 2011 13:26:30 -0700 (PDT) Original-Received: by pluto.luannocracy.com (Postfix, from userid 501) id C19C96863AC; Sun, 3 Jul 2011 16:26:28 -0400 (EDT) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sun, 03 Jul 2011 18:15:18 +0200") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/23.3 (darwin) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 03 Jul 2011 16:27:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:47862 Archived-At: on Sun Jul 03 2011, Lars Magne Ingebrigtsen wrote: > Dave Abrahams 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