GNU bug report logs - #16062
24.3; Missing .png file gives poor error message when opened

Previous Next

Package: emacs;

Reported by: Alex Willisson <atw <at> mit.edu>

Date: Thu, 5 Dec 2013 21:32:02 UTC

Severity: minor

Tags: fixed

Found in version 24.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jarek Czekalski <jarekczek <at> poczta.onet.pl>
Cc: 16062 <at> debbugs.gnu.org
Subject: bug#16062: 24.3; Missing .png file gives poor error message when opened
Date: Sat, 07 Dec 2013 09:27:32 +0200
> Date: Fri, 06 Dec 2013 22:05:17 +0100
> From: Jarek Czekalski <jarekczek <at> poczta.onet.pl>
> 
> W dniu 12/06/2013 09:38 AM, Eli Zaretskii pisze:
> > Is it?  What if I come up with an Emacs mode that lets users _create_
> > PNG files?
> 
> What I actually had in mind was that Emacs already does this guessing 
> (what was the intention of opening a png file) and we don't want to 
> change this process. But after we decided we want to display the 
> graphics and before passing the filename to the graphic library, we 
> should check if file exists.

That's not how "C-x C-f" works in this case.  It visits the file as
usual, and then turns on image-mode, which instructs the image library
to display the image using the data we already have in the buffer.  So
the file name is never passed to the image library.

IOW, Emacs does the same in this case as when you type

  C-x C-f non-existent-file.c RET

In the latter case, you get an empty buffer that is in CC mode, and a
message "(New file)" in the echo area.

Therefore, I submit that the problem is with image-mode, which barfs
on empty buffers, obviously assuming such situations won't happen.

> If file does not exist - give the exact message or fallback to 
> non-graphical mode. Both solutions would make it obvious, that the file 
> does not exists. I guess that's the intention of Alex, who reported this.

Would it be wrong to have an empty buffer put in image-mode and "(New
file)" displayed in the echo area?  That is how Emacs behaves in any
other case when the user visits a file that does not exist.




This bug report was last modified 4 years and 271 days ago.

Previous Next


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