From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.devel Subject: Re: yank-media: allow users to limit image types that can be inserted Date: Tue, 24 Sep 2024 10:38:53 +0530 Message-ID: <87ikulwsd6.fsf@gmail.com> 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> <8634lqfcaf.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21748"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: pinmacs , rpluim@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 24 07:09:27 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 1ssxnj-0005TC-4D for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Sep 2024 07:09:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssxnM-0006rT-4G; Tue, 24 Sep 2024 01:09:04 -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 1ssxnK-0006rK-FZ for emacs-devel@gnu.org; Tue, 24 Sep 2024 01:09:02 -0400 Original-Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssxnI-0007A6-Q4; Tue, 24 Sep 2024 01:09:02 -0400 Original-Received: by mail-pl1-x643.google.com with SMTP id d9443c01a7336-20688fbaeafso54027765ad.0; Mon, 23 Sep 2024 22:08:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727154538; x=1727759338; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zEn4BS7ghRhBMB3VZcCfx6wP8pTjBdiXz9qBJV7bh6U=; b=DD2X4vTB8aMZyDHKytK8StnQGKCKkej8LD3Fr/Y8YsBQ6+r/oBgggPAJGVCe0BsoPi IHb6hMmorgRjoj1kjhzQ+vWs0hHMOdEY/y8bnDJG9Nbp/D+OAptKwGbQVrBbL7EBvoxL pQZqFefx+NhsLycfRxDsyOJ/BPdKqnbjYNgl7yoqxmgfYn28ZQtpL8I6vyHrLVh5WxVk JfNW+tfekVKVwZqtfc2O+qzijfvU796r34pXaHV9DEQH6Rs2PzFYvNzRPGSBUjmkWTf7 Hpf5LQ+mXWUQCnReVXtcR/LRGjHush9zBFZzrAgfPqtoia59Z4c7ABee8otOdR4NKbji M/EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727154538; x=1727759338; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zEn4BS7ghRhBMB3VZcCfx6wP8pTjBdiXz9qBJV7bh6U=; b=nlRwDyOSrGJtoR97duAth3c1kIvJRTJzlgvRSTkEnPwNLzy5Kls6cV/FojOdFhElCY ZsKPLprLp4fksmBIQ85kBM6Vsho5voPsKdRdwvEkCxzU8P7sVHbx8COip+YVYcm8EO97 +DybQZHLF317bzWLHk1GQ2f2XyvXdcIAt7x2ncodU5fS5MEzL77kOSIPkOhTnmH9Te4D gfybmttH2KkZM5wyhWFRcc8D7t0JgaRjWNLheR6uzJaB+f7G2Ru4rbi3qfbYDTMN0DWH OwUlBXXvfX1BiWDQPqlJqm4zM1PpfZiZHnaf4OM8UUIfVcjCf+qBs/Lg0sK9SCcOt36t l8bQ== X-Forwarded-Encrypted: i=1; AJvYcCVummRo5Q3gMD1sKLMp212gR3MBuJKXWSqFaz0zotBfpyIqq9cB4w94N+PUCunFyn2Hh2+RbctMiiVYcw==@gnu.org X-Gm-Message-State: AOJu0YwyiYT0Z5EBmOtqugm8uczMLDI9iMTXf00Bt5aNWuvH2pr/V0az IyMdoQf0bhc1RAKwqExrWg0Al+jLqjH3ejdgq28aOjgPsNMrM6J4yjMPHikK X-Google-Smtp-Source: AGHT+IHBY2sjs5SLxOGkVxgJST5h87+COw5+9tYaVGsPxkXf54DFo8isSaMnPt0FaikGcx7pbnLIeA== X-Received: by 2002:a17:902:e811:b0:202:38d8:173 with SMTP id d9443c01a7336-208d83a83e3mr238122445ad.29.1727154538391; Mon, 23 Sep 2024 22:08:58 -0700 (PDT) Original-Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af185b07csm3438465ad.290.2024.09.23.22.08.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 22:08:58 -0700 (PDT) In-Reply-To: <8634lqfcaf.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Sep 2024 21:35:52 +0300") Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x643.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:324007 Archived-At: [=E0=AE=A4=E0=AE=BF=E0=AE=99=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D =E0=AE=9A= =E0=AF=86=E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0= =AF=8D 23, 2024] Eli Zaretskii wrote: >> Date: Mon, 23 Sep 2024 15:00:54 -0300 >> Cc: visuweshm@gmail.com, emacs-devel@gnu.org >> From: pinmacs >>=20 >> Before yank-media, I was using org-download [1], so I got used to just=20 >> insert a screenshot with no question to answer (such as the type of the= =20 >> image). >>=20 >> Recently, I moved to yank-media, but to have the same functionality, I=20 >> had to tweak it a little bit, full detail here [2]. >>=20 >> I see utility on asking for the image/png and image/jpeg and here you=20 >> 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? [ The more I think about this, the more I believe the choice of "preferred formats" will change depending on the scenario where yank-media is used. In Org, I could see "don't bother asking me, just use PNG if available" could be useful. But somewhere in HTML mode, "always ask me" could be the right choice. ] > 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 What about a user option yank-media-preferred-mimetypes which is a list of mimetypes that the user would like to always opt for, given the choice? . If there is only mimetype available, then we simply choose that type's handler without consulting the user option. . If there are more than one mimetype available, we pick those mimetypes that are in the user option. . If more than one mimetype from the user option is matched, we ask the user what format, among the matched, they want to use. . If none of the mimetypes available match those in the user option, we again ask the user to choose from all available formats (we delegate to option (2) below) > (2) via showing the list of all the formats that the running Emacs > supports and asking the user to choose one. This is what we already have so nothing to be changed. > If we can agree on this, we should now discuss those algorithms for > selecting a single media type. > > Thanks.