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.devel Subject: Re: yank-media: allow users to limit image types that can be inserted Date: Mon, 23 Sep 2024 21:35:52 +0300 Message-ID: <8634lqfcaf.fsf@gnu.org> References: <79fc91f3-c2c3-44db-9817-595808917f26@cas.cat> <86ed5ahb08.fsf@gnu.org> <87zfnywki8.fsf@gmail.com> <86setqfnmq.fsf@gnu.org> <87frpqflv4.fsf@gmail.com> <86ikumfjri.fsf@gnu.org> <877cb2fj0c.fsf@gmail.com> <86cykufhw7.fsf@gnu.org> <3a015d0f-549a-401f-be1c-651c9dbd5d9a@cas.cat> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31424"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, visuweshm@gmail.com, emacs-devel@gnu.org To: pinmacs Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 23 20:36:31 2024 Return-path: Envelope-to: ged-emacs-devel@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 1ssnvC-0007yA-Iu for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Sep 2024 20:36:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssnuh-0005ti-Oh; Mon, 23 Sep 2024 14:35:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ssnug-0005tP-40 for emacs-devel@gnu.org; Mon, 23 Sep 2024 14:35:58 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ssnud-0006CN-Ii; Mon, 23 Sep 2024 14:35:56 -0400 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=YnKTpn9QhKiI9dhrL4FoXRGx9DPexrolaXdOJKx5USQ=; b=X08VBCiyE9nn gDtHqP3FtN1rrP6wRliaqynXoOqBIyTpsQ5Aq7gRsiXAaXnN17w9Cahvazg5r62Ir8/Q/xiPiZaxq O7Dk0m14r5tSULs0ec7jG8sBcfdKXuVVQDWSL7NbothMhy2boB6gOG4C/nFXO8TjFA1O+XzvndEkM lh8GsvNwB6i9m1XV9uwxEBQzGaUHI+XOPoIT1ZogRd06btParcbnBwyuqFK6Xoshye+VzVEhanInb HBulzxFUnmgtlStql8eYNRn+hE9XcU/OwLNklhP8MbN+LBlmEso76lJHxhPp+RWC4YY/hNYnBbJmo YXaDmsk7pHgvhKRfclXViA==; In-Reply-To: <3a015d0f-549a-401f-be1c-651c9dbd5d9a@cas.cat> (message from pinmacs on Mon, 23 Sep 2024 15:00:54 -0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323993 Archived-At: > Date: Mon, 23 Sep 2024 15:00:54 -0300 > Cc: visuweshm@gmail.com, emacs-devel@gnu.org > From: pinmacs > > Before yank-media, I was using org-download [1], so I got used to just > insert a screenshot with no question to answer (such as the type of the > image). > > Recently, I moved to yank-media, but to have the same functionality, I > had to tweak it a little bit, full detail here [2]. > > I see utility on asking for the image/png and image/jpeg and here you > have details why you would care about [3]. This just says that PNG is always preferable to JPEG if both are available. As I already said, I'm okay with the idea of having C-y or similar key to decide which format to use, and so what you are saying (and I agree) that it should always choose PNG if Emacs supports it. What I still do not understand is what would be the reason for the user to prefer JPEG over PNG. More generally, if Emacs can support N formats out of those available in the clipboard, why would the user want to be shown only 1 < M < N out of them? Furthermore, your request was even more broad and general: it asked for some filtering infrastructure, and I'm still trying to understand why that would be needed. The discussion to which you point on the Org list doesn't explain the rationale, either. Bottom line: I'm okay with offering two yank-media alternatives: (1) via a command that selects a single most appropriate format based on some (yet to be defined) algorithm; and (2) via showing the list of all the formats that the running Emacs supports and asking the user to choose one. If we can agree on this, we should now discuss those algorithms for selecting a single media type. Thanks.