From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#9139: 24.0.50; Inappropriate warning: "File no longer exists!" Date: Sun, 11 Sep 2011 02:00:10 -0400 Message-ID: References: <87d3h4t20s.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1315720865 12042 80.91.229.12 (11 Sep 2011 06:01:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2011 06:01:05 +0000 (UTC) Cc: 9139-done@debbugs.gnu.org, bzg@altern.org To: Lars Magne Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 11 08:01:01 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 1R2d6D-0005Nq-8n for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2011 08:01:01 +0200 Original-Received: from localhost ([::1]:53725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2d6C-0000E2-Eq for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 Sep 2011 02:01:00 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2d67-0000DD-Ap for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 02:00:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R2d61-0006sh-Bq for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 02:00:55 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41917) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2d61-0006sb-8p for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 02:00:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R2dA6-0005Et-No for bug-gnu-emacs@gnu.org; Sun, 11 Sep 2011 02:05:02 -0400 Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 Sep 2011 06:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 9139 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 9139@debbugs.gnu.org, eliz@gnu.org Original-Received: via spool by 9139-done@debbugs.gnu.org id=D9139.131572107720106 (code D ref 9139); Sun, 11 Sep 2011 06:05:02 +0000 Original-Received: (at 9139-done) by debbugs.gnu.org; 11 Sep 2011 06:04:37 +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 1R2d9f-0005EC-4D for submit@debbugs.gnu.org; Sun, 11 Sep 2011 02:04:37 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R2d9X-0005Dw-Fn for 9139-done@debbugs.gnu.org; Sun, 11 Sep 2011 02:04:29 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1R2d5O-0008ID-Eo; Sun, 11 Sep 2011 02:00:10 -0400 In-reply-to: (message from Lars Magne Ingebrigtsen on Sun, 11 Sep 2011 04:52:29 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sun, 11 Sep 2011 02:05:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:50865 Archived-At: > From: Lars Magne Ingebrigtsen > Date: Sun, 11 Sep 2011 04:52:29 +0200 > Cc: 9139@debbugs.gnu.org > > > emacs -Q > > C-x f ~/foo.txt > > C-x b bar > > C-x f ~/foo.txt > > > > => File no longer exists! > > Yes, it shouldn't say anything in this instance. > > But how? It's this code in files.el: > > (cond ((not (file-exists-p filename)) > (setq nonexistent t) > (message "File %s no longer exists!" filename)) The magic is in the previous line. The code does this: (or nowarn (verify-visited-file-modtime buf) (cond ((not (file-exists-p filename)) (setq nonexistent t) (message "File %s no longer exists!" filename)) The problem was that verify-visited-file-modtime would return nil in this case, where it returned t in Emacs 23. And that's because the internal details of verify-visited-file-modtime changed, but insert-file-contents didn't have the corresponding change. It does now (revno 105721). > (visited-file-modtime) > => (-1 65535) > > in foo.txt. But is that a bug? No. -1 as the modtime exactly means that the file does not exist. So at most we need to update the doc string, assuming that we want to reveal such implementation details. Btw, WIBNI visited-file-modtime returned (-1 -1) in this case, instead of forcing us to invoke the unsigned-to-signed converter in our heads? > So I think that perhaps is should return 0? Zero is for existing files that were not modified since visited.