GNU bug report logs -
#54084
28.0.91; Regression: can't create empty image buffer
Previous Next
Reported by: Corwin Brust <corwin <at> bru.st>
Date: Mon, 21 Feb 2022 08:22:01 UTC
Severity: normal
Found in version 28.0.91
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 54084 <at> debbugs.gnu.org (full text, mbox):
[Please use Reply All, so that the bug tracker remains on the CC.]
> From: Corwin Brust <corwin <at> bru.st>
> Date: Mon, 21 Feb 2022 07:41:36 -0600
>
> On Mon, Feb 21, 2022 at 6:57 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > It's a feature, see bug#16062. (It misfired when the empty buffer
> > wasn't visiting a file, but I've now fixed that on the release
> > branch.)
>
> Is there a way to disable this feature?
Why is that needed? Turning on image-mode in an empty buffer is a
pretty strange thing to do, or at least a rare thing.
> In my case the image type won't change, I'd be fine hard-coding
> that.
>
> >
> > You are supposed to insert the data, and then turn on image-mode. We
> > don't support image-mode in empty buffers, because that makes it
> > impossible to detect the image type, and thus leads to complications
> > down the road.
> >
> > Thanks.
>
> I'm not sure how to avoid this error when I create a new buffer in a
> mode derived from image mode.
Can't you use ignore-errors?
> Is there an alternative you can recommend to creating my own
> "one-off" version of image mode and deriving from that? In my case,
> I have created an SVG sketching mode and have been reusing,
> e.g. "canvas" resizing logic from image-mode for a couple of years
> without issue.
>
> TIA for any hints.
How about delaying the mode switch until the user inserted something?
This bug report was last modified 3 years and 91 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.