From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Image-conversion shims Date: Wed, 09 Oct 2019 21:26:04 +0200 Message-ID: <87r23l67qr.fsf@gnus.org> References: <87v9tctcca.fsf@gnus.org> <87impct2xf.fsf@gnus.org> <83zhinfufb.fsf@gnu.org> <87ftkfnx7a.fsf@gnus.org> <83eezzfh8c.fsf@gnu.org> <8736gea0do.fsf@gnus.org> <87muedrg7d.fsf@mail.linkov.net> <878spxe3hb.fsf@gnus.org> <87k19gwfwb.fsf@mail.linkov.net> <87h84j1asf.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="6152"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org, Juri Linkov To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 09 23:22:30 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIJPh-0001QX-GP for ged-emacs-devel@m.gmane.org; Wed, 09 Oct 2019 23:22:29 +0200 Original-Received: from localhost ([::1]:58660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIJPf-00008e-Vs for ged-emacs-devel@m.gmane.org; Wed, 09 Oct 2019 17:22:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53963) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIHbD-0002E5-Hw for emacs-devel@gnu.org; Wed, 09 Oct 2019 15:26:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIHbB-0002zN-J1 for emacs-devel@gnu.org; Wed, 09 Oct 2019 15:26:15 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:36638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIHb9-0002yS-MS; Wed, 09 Oct 2019 15:26:13 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iIHb3-0003bv-CH; Wed, 09 Oct 2019 21:26:07 +0200 In-Reply-To: (Stefan Monnier's message of "Tue, 08 Oct 2019 13:47:58 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.91.231.51 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240797 Archived-At: Stefan Monnier writes: > I still can't see why we should care about our ability to display an > image before preferring image-mode over fundamental-mode. It just feels odd to be mapping file extensions to a mode when we don't know whether that mode can display the file meaningfully or not. We don't do that with other file types, so why with images? But in practice I guess it doesn't make much difference. It's more of a cleanliness thing. > IOW, I think the auto-mode-alist entries should be added statically not > based on what we can do with them, but based on what the extension means > in practice. > > Typically, there are various cases: > - things like .svg and .xpm which can be meaningfully viewed as "an > image" or as "a text file". There, we should make sure the user can > switch between those two views (and default to text if we can't > display the image, e.g. via image-mode-maybe). > - extensions which are sometimes used for images and sometimes for > completely unrelated purposes. We should decide based on > which is most likely to the case. Since we don't default to using the external converters for exotic image formats, when the user has switched it on, that's a signal that the user does want those to be mapped to images, perhaps, which is a practical argument for having the mappings be dynamic. > - extensions which are always images and can't meaningfully be edited > within Emacs, so only image-mode makes sense. In that case we should change image-mode to not display stuff like this for formats it doesn't understand: Type C-c C-c or C-c C-x to view the image as an image or hex. Cannot display image: (Cannot determine image type) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no