all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: 9139-done@debbugs.gnu.org, bzg@altern.org
Subject: bug#9139: 24.0.50; Inappropriate warning: "File no longer exists!"
Date: Sun, 11 Sep 2011 02:00:10 -0400	[thread overview]
Message-ID: <E1R2d5O-0008ID-Eo@fencepost.gnu.org> (raw)
In-Reply-To: <m38vpv3i4y.fsf@stories.gnus.org> (message from Lars Magne Ingebrigtsen on Sun, 11 Sep 2011 04:52:29 +0200)

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> 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.





  reply	other threads:[~2011-09-11  6:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-21  9:29 bug#9139: 24.0.50; Inappropriate warning: "File no longer exists!" Bastien
2011-07-21 10:17 ` Eli Zaretskii
2011-07-21 10:27   ` Bastien
2011-09-11  2:52 ` Lars Magne Ingebrigtsen
2011-09-11  6:00   ` Eli Zaretskii [this message]
2011-09-11 14:49     ` Lars Magne Ingebrigtsen
2011-09-11 18:57     ` Glenn Morris
2011-09-11 20:05       ` Eli Zaretskii
2011-09-11 23:32     ` bug#7547: Glenn Morris

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=E1R2d5O-0008ID-Eo@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=9139-done@debbugs.gnu.org \
    --cc=bzg@altern.org \
    --cc=larsi@gnus.org \
    /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.