From unknown Wed Jun 18 00:26:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#24586 <24586@debbugs.gnu.org> To: bug#24586 <24586@debbugs.gnu.org> Subject: Status: 24.5; `find-file' for non-existent file a.jpg should not complain Reply-To: bug#24586 <24586@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:26:58 +0000 retitle 24586 24.5; `find-file' for non-existent file a.jpg should not comp= lain reassign 24586 emacs submitter 24586 Drew Adams severity 24586 minor tag 24586 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 02 12:27:53 2016 Received: (at submit) by debbugs.gnu.org; 2 Oct 2016 16:27:53 +0000 Received: from localhost ([127.0.0.1]:42120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqjcG-000312-Uw for submit@debbugs.gnu.org; Sun, 02 Oct 2016 12:27:53 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqjcE-00030m-TS for submit@debbugs.gnu.org; Sun, 02 Oct 2016 12:27:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqjc8-0003oo-QZ for submit@debbugs.gnu.org; Sun, 02 Oct 2016 12:27:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51651) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqjc8-0003oA-Nx for submit@debbugs.gnu.org; Sun, 02 Oct 2016 12:27:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqjc6-00070Q-C3 for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2016 12:27:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqjc1-0003kU-8w for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2016 12:27:41 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:25736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqjc0-0003jK-WF for bug-gnu-emacs@gnu.org; Sun, 02 Oct 2016 12:27:37 -0400 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u92GRYHR022957 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 2 Oct 2016 16:27:34 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id u92GRYqk028536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 2 Oct 2016 16:27:34 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u92GRWIO023973 for ; Sun, 2 Oct 2016 16:27:33 GMT MIME-Version: 1.0 Message-ID: <7551034a-2464-4925-9020-20e853e2db3d@default> Date: Sun, 2 Oct 2016 09:27:31 -0700 (PDT) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 24.5; `find-file' for non-existent file a.jpg should not complain X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9 (901082) [OL 12.0.6753.5000 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Source-IP: userv0022.oracle.com [156.151.31.74] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) emacs -Q C-x C-f a.jpg ; Where file `a.jpg' does not exist This presents these error/warning messages, but it does not raise an error: Type C-c C-c to view the image as an image. Cannot display image: (Cannot determine image type) This seems wrong, because the file does not exist. If you are trying to create an ordinary text file that happens to match an image-file name pattern, you should be able to do so, without getting such messages. It could be helpful to instead get a message confirming that this is in fact what you are doing. Or if it is considered wrong to do that then Emacs should raise an error. IOW, either raise an error, if you are not allowed to create a new file whose name matches an image file, or else show a different message, saying, e.g., that no such image file exists and the buffer is therefore not in image mode (and it should in that case not be put in image mode). It seems wrong to both put the new buffer for the non-existent file in image mode and to complain that Emacs cannot display the image. And the first message, about typing C-c C-c seems doubly inappropriate. In GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/usr --host=3Di686-pc-mingw32' From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 04 20:03:58 2016 Received: (at 24586) by debbugs.gnu.org; 5 Oct 2016 00:03:58 +0000 Received: from localhost ([127.0.0.1]:45017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1brZgj-0005u2-PT for submit@debbugs.gnu.org; Tue, 04 Oct 2016 20:03:57 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:33558) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1brZgi-0005tj-AL; Tue, 04 Oct 2016 20:03:56 -0400 Received: by mail-io0-f169.google.com with SMTP id q192so5009832iod.0; Tue, 04 Oct 2016 17:03:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=LGTMK/++MV80cOFeoRRLxSJXNSUNqwKDz1DZe6OW6dQ=; b=pncTTguIddmCaKqccRz3unWn8tJmNOwL74RDI640rY8+PZRctRkqOhvmwGpmb9sTjN P84AYF4Crcl1B9UitrmCD+V+ZuqZOBX94WqVurOU6RC93cfF6pjl3YGZEHRHdfZHPSaS D3nZQHiRKZ6tukDblhpsioreEGxfVNahh25dTWyrSacGmPv7+2KSUAd1MW0l8bbvieYx E37ZHvb+1Rm78NFOKmw8di6ApZ0IcFJTpbuLD5aJCWgfZbkKUXNGDDiPPh7ZJCrVhS2e +LXksuv/CngOBUNl6GfePher8urQrK67jVQrk1SQagz9xdlc576RKQ+bC841OJdfDE7D qMJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=LGTMK/++MV80cOFeoRRLxSJXNSUNqwKDz1DZe6OW6dQ=; b=XNFpkwTSzhdM4is7g/qxF36mhC908forfp8aCllpvATVXineQ01altru5V79tBSvO3 n2muUsVPfGCmuXkjLTK3sFOnZaWR0NBvB6lfqhDC7Pwh04lHmYyMjyQ3NIJH7AU0CKJM C80wqZrzCCOXwyxDOBnU1u0ZJ5nCfdA1HXUOjoUV188AHBZvfWfi+wE0LUbx28hfyLlS EpozZUrEM4mFgHHtJC72BH4fNYkUaLPFL7ycbXJhR3pRHVPPy8vvyXao9hGb9nmXfZcz VOGy2rCowrB49NGmDxmo4CPiiPzXnGWhBZ6jv4DeZvCczzywpoEwXqjLWvE9aY2Gbtbx t41A== X-Gm-Message-State: AA6/9RmsNlWpVwxw4uneMld1G8GYnOKkTzpziwrPIhoGscYLkW+TrUWAjF9yiPNtf3AWSg== X-Received: by 10.107.134.142 with SMTP id q14mr6949660ioi.220.1475625830302; Tue, 04 Oct 2016 17:03:50 -0700 (PDT) Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id t14sm2582176itb.22.2016.10.04.17.03.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Oct 2016 17:03:49 -0700 (PDT) From: npostavs@users.sourceforge.net To: Drew Adams Subject: Re: bug#24586: 24.5; `find-file' for non-existent file a.jpg should not complain References: <7551034a-2464-4925-9020-20e853e2db3d@default> Date: Tue, 04 Oct 2016 20:04:22 -0400 In-Reply-To: <7551034a-2464-4925-9020-20e853e2db3d@default> (Drew Adams's message of "Sun, 2 Oct 2016 09:27:31 -0700 (PDT)") Message-ID: <87int7y83d.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 24586 Cc: 24586@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) severity 24586 minor quit Drew Adams writes: > emacs -Q > > C-x C-f a.jpg ; Where file `a.jpg' does not exist > > This presents these error/warning messages, but it does not raise an > error: > > Type C-c C-c to view the image as an image. > Cannot display image: (Cannot determine image type) > > This seems wrong, because the file does not exist. If you are trying to > create an ordinary text file that happens to match an image-file name > pattern, you should be able to do so, without getting such messages. It > could be helpful to instead get a message confirming that this is in > fact what you are doing. > > Or if it is considered wrong to do that then Emacs should raise an > error. > > IOW, either raise an error, if you are not allowed to create a new file > whose name matches an image file, or else show a different message, > saying, e.g., that no such image file exists and the buffer is therefore > not in image mode (and it should in that case not be put in image mode). > > It seems wrong to both put the new buffer for the non-existent file in > image mode and to complain that Emacs cannot display the image. And > the first message, about typing C-c C-c seems doubly inappropriate. But then what would a user who wants to type the raw jpeg bytes into a buffer and use C-c C-c to check the result do? ;) Possible solutions: 1. Use the content-based magic-mode-alist to recognize images instead of the filename-based auto-mode-alist. 2. Add a check to `image-mode' for an empty buffer and stay in fundamental-mode in that case. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 20 17:01:25 2020 Received: (at 24586) by debbugs.gnu.org; 20 Aug 2020 21:01:25 +0000 Received: from localhost ([127.0.0.1]:44296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8rgb-000855-AE for submit@debbugs.gnu.org; Thu, 20 Aug 2020 17:01:25 -0400 Received: from quimby.gnus.org ([95.216.78.240]:34218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8rgY-00084m-Ex for 24586@debbugs.gnu.org; Thu, 20 Aug 2020 17:01:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=vAXJxhAnhKSwSM5A9jawMhjMKQkhX0rHDeMbPLcBGxo=; b=EYiPe0623X73wcrKygIizm0lB8 Z+MzYOB7dx/ZYoiE98Dgdv9hsZ1K7rPX5c5zSTEkT3t/fPTEa7bRfi7m0DLEgPkDuLzTfdNvMrhIh H3x3vuNsiT2bfSdPFKUk3EfBwq7cx7vzR5I/IQczSWoPI8Jp0nSc2XpEb96B7iYof6ec=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8rgP-0002S8-Ap; Thu, 20 Aug 2020 23:01:15 +0200 From: Lars Ingebrigtsen To: Drew Adams Subject: Re: bug#24586: 24.5; `find-file' for non-existent file a.jpg should not complain References: <7551034a-2464-4925-9020-20e853e2db3d@default> X-Now-Playing: Tuxedomoon's _Live in London (1982)_: "59 To 1" Date: Thu, 20 Aug 2020 23:01:12 +0200 In-Reply-To: <7551034a-2464-4925-9020-20e853e2db3d@default> (Drew Adams's message of "Sun, 2 Oct 2016 09:27:31 -0700 (PDT)") Message-ID: <874koxjalj.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Drew Adams writes: > emacs -Q > > C-x C-f a.jpg ; Where file `a.jpg' does not exist > > This presents these error/warning messages, but it does not raise an > error: > > Type C-c C-c to view the image as an image. > Can [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24586 Cc: 24586@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Drew Adams writes: > emacs -Q > > C-x C-f a.jpg ; Where file `a.jpg' does not exist > > This presents these error/warning messages, but it does not raise an > error: > > Type C-c C-c to view the image as an image. > Cannot display image: (Cannot determine image type) This is fixed in Emacs 28 now. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 20 17:01:30 2020 Received: (at control) by debbugs.gnu.org; 20 Aug 2020 21:01:30 +0000 Received: from localhost ([127.0.0.1]:44299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8rgg-00085Q-Ho for submit@debbugs.gnu.org; Thu, 20 Aug 2020 17:01:30 -0400 Received: from quimby.gnus.org ([95.216.78.240]:34232) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k8rge-00084v-As for control@debbugs.gnu.org; Thu, 20 Aug 2020 17:01:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0hn4YdXN5LY7m/JIlx9YPrvEBsHVEEbkOOx7QeaU3Rg=; b=OfQKOVCHjM8wuyttxN5XJkdynq M/nq8DTx43kTClnG0eIhaFvS/x9GPuc41a2JCfRA4OKftKbSeXXEEgnECudaYlWrSW0/bKR4xigXJ Z3DBuSj9JfZ1mYLD5nsCO4VCxyOJkrs32LI3GNNRA4FCxEahMoRDwYxeOI2oUvzKihe4=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k8rgW-0002SH-GI for control@debbugs.gnu.org; Thu, 20 Aug 2020 23:01:22 +0200 Date: Thu, 20 Aug 2020 23:01:19 +0200 Message-Id: <87364hjalc.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #24586 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 24586 fixed close 24586 28.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 24586 fixed close 24586 28.1 quit From unknown Wed Jun 18 00:26:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 18 Sep 2020 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator