From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#54084: 28.0.91; Regression: can't create empty image buffer Date: Mon, 21 Feb 2022 16:00:12 +0200 Message-ID: <83mtikuxoz.fsf@gnu.org> References: <83sfscv0kz.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26205"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54084@debbugs.gnu.org To: Corwin Brust Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 21 15:09:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nM9NM-0006dX-4R for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Feb 2022 15:09:16 +0100 Original-Received: from localhost ([::1]:47516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nM9NL-0004yU-3t for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Feb 2022 09:09:15 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM9FO-0003wS-FU for bug-gnu-emacs@gnu.org; Mon, 21 Feb 2022 09:01:11 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41565) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nM9FO-0005KJ-4U for bug-gnu-emacs@gnu.org; Mon, 21 Feb 2022 09:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nM9FN-0002vZ-Op for bug-gnu-emacs@gnu.org; Mon, 21 Feb 2022 09:01:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Feb 2022 14:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54084 X-GNU-PR-Package: emacs Original-Received: via spool by 54084-submit@debbugs.gnu.org id=B54084.164545202011186 (code B ref 54084); Mon, 21 Feb 2022 14:01:01 +0000 Original-Received: (at 54084) by debbugs.gnu.org; 21 Feb 2022 14:00:20 +0000 Original-Received: from localhost ([127.0.0.1]:35462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nM9Ei-0002uM-IC for submit@debbugs.gnu.org; Mon, 21 Feb 2022 09:00:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:40566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nM9Ed-0002tz-TN for 54084@debbugs.gnu.org; Mon, 21 Feb 2022 09:00:19 -0500 Original-Received: from [2001:470:142:3::e] (port=51842 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM9EX-0005C9-Og; Mon, 21 Feb 2022 09:00:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7NcdYo3HwCj1CNslel0z/s+GySHt0QYdo3VoyOW3mGA=; b=Tvu10V6XWReX /57VlB8JM1Y7R51LlnnAREauton2ezZp+ep9OGnYPuZWOhjYdCqMMhOadPTifgI8zBiRoBE4nenWY TaZvK+sXMRudFXm9soWYfDd/WkcsNbC0K4IZNvQc1Axtgy1cd0m2xuTON0Bu+ntGYFdU0i2WZLFbk 7OEHrYVb1Q0Esm5BwI8c7SjPJh4o1gfpVrarZkX5CimNFadROheTPwo3Omd8TcxyPloATUbClNNVm alO5u7QZVBYIHbaHt+QpNJqnDJxPosfM+YhGJcS4W1xbDW4FNYTVY3uSD74eww7sruU9AmBXHoUdB MSWmFi5YNVBPdnDROZ1OyQ==; Original-Received: from [87.69.77.57] (port=1545 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nM9EW-0002bR-5E; Mon, 21 Feb 2022 09:00:09 -0500 In-Reply-To: (message from Corwin Brust on Mon, 21 Feb 2022 07:41:36 -0600) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:227336 Archived-At: [Please use Reply All, so that the bug tracker remains on the CC.] > From: Corwin Brust > Date: Mon, 21 Feb 2022 07:41:36 -0600 > > On Mon, Feb 21, 2022 at 6:57 AM Eli Zaretskii 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?