From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: yank-media: allow users to limit image types that can be inserted Date: Mon, 23 Sep 2024 18:10:43 +0200 Message-ID: <877cb2fj0c.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> 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="38607"; mail-complaints-to="usenet@ciao.gmane.io" Cc: visuweshm@gmail.com, pinmacs@cas.cat, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 23 18:11:28 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 1ssleq-0009rf-84 for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Sep 2024 18:11:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssleE-0004HC-KH; Mon, 23 Sep 2024 12:10:50 -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 1ssleC-0004Gv-S2 for emacs-devel@gnu.org; Mon, 23 Sep 2024 12:10:48 -0400 Original-Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssleB-0007el-6i; Mon, 23 Sep 2024 12:10:48 -0400 Original-Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42cb0f28bfbso38384775e9.1; Mon, 23 Sep 2024 09:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727107845; x=1727712645; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date :gmane-reply-to-list:references:in-reply-to:subject:cc:to:from:from :to:cc:subject:date:message-id:reply-to; bh=tcG9UbU3Z98uKGA+o7lDaRg5laNQjJv20A8Q26nMB7s=; b=gLbRs4Ts//kBMujS58lGcRQY6AqXdu92ZjDMRZISVsPGz8bO135ijkZ9ifwC3kb3uy +gGVc1aNHjVKzJxm8qMMx2HUbzfe4AC8ZIFPQ2h59EODeEVbqy/sw6WUm+4nToefDzQx EAd2uUK+t01+Y9EygGN2iMzw0TbibZkEvjJ+oROOiEgc2NnXkCTku0PZOGoc6i5BJwwx dnfvEjT7o35PXXEDWFMOXf7APg89HgDmy25hodpI9UXXibR1fP+8C6uRpu9mG2Kf/uLa xRP2/2J2EDWdd0rO0Aet6v1ectZdETikLaFSC/6yLzvL8pS6Nd2zqvsSzFvdKBO8KMMv UuPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727107845; x=1727712645; h=content-transfer-encoding:mime-version:message-id:date :gmane-reply-to-list:references:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tcG9UbU3Z98uKGA+o7lDaRg5laNQjJv20A8Q26nMB7s=; b=TVpMThKhWNWMQJZEU+iLZAMUunSHdYvPG5drSe1oJVHgAekPEOUYXXw7W/P5m3JdqC GU7Rsuah2pZCRI3mEaq/B4WUBmsAxotr2OZObbebnxHuzMw7tKQUxMCaw6cRbIhWFaKJ jXqPF2IEAUJsr3nqxebUrc321xvhtVqRFAJxP6eAvr+21ocoSKnfOuEz8oPr2EgXMEBp hPi5HeOa/8uQuhQo8P5lGAGu826NWWjX2UkTusyx0vAK/oLFUmqsIlZfV3vHomGLxGnq 9SwjcvlGD907kg8g1dqS4o3bv3Ql3fywDd33YK9fKOEtSJ7vFJ9q6s/6RMMMNhZYAp24 wAxg== X-Forwarded-Encrypted: i=1; AJvYcCUkju1QcY10sKPQ3xWXuCpLcrtyBV6UNU4qhswIMpLnlqdqZnVjgW63aDtWInzizVU3xyxVDBLsEa1avA==@gnu.org X-Gm-Message-State: AOJu0Yzg0WycTzr5qJPp3/scsSPQb8EN1lfdHTlgQ3ptCXMtqC/IrEJ2 ksLEs54r6w8Wy427SjH1mcmUvaIkYxVio+HQYm/v3oJ9hJu1uDagHVWJVA== X-Google-Smtp-Source: AGHT+IH5TG89sqR7YRiZg/cutiGB6PZRFNG5xhz2qBYdjHpHdcRIqKPcbjQtmwou1U96uO9wu/vrxw== X-Received: by 2002:a05:600c:4f82:b0:42b:a9b4:3f59 with SMTP id 5b1f17b1804b1-42e7abf7fe4mr81124195e9.14.1727107844470; Mon, 23 Sep 2024 09:10:44 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb51:4318:aaaa:4cce:d340]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42e7540e2c1sm132029615e9.2.2024.09.23.09.10.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 09:10:44 -0700 (PDT) In-Reply-To: <86ikumfjri.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Sep 2024 18:54:25 +0300") Gmane-Reply-To-List: yes Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=rpluim@gmail.com; helo=mail-wm1-x330.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:323973 Archived-At: >>>>> On Mon, 23 Sep 2024 18:54:25 +0300, Eli Zaretskii said: >> From: Robert Pluim >> Cc: Visuwesh , pinmacs@cas.cat, emacs-devel@g= nu.org >> Date: Mon, 23 Sep 2024 17:09:03 +0200 >>=20 Eli> IMO, for users we already have what is needed: when we detect seve= ral Eli> formats, we show them to the user and ask him/her to tell us which Eli> format he/she wants to use. >>=20 >> But that requires user interaction. I think the original request cou= ld >> be summed up as "if the list contains image/png, don=CA=BCt ask me, = just >> insert the image". Eli> That's not how I understand the request. It was not always PNG, it Eli> was "sometimes PNG, but if so-and-so-happens, the JPEG" etc. Yes, but the "so-and-so" is determined by a user option. So 1. Always prefer "png" -> user option =3D=3D "png" 2. Want to choose between "png" and "jpeg" -> user option =3D=3D ("png" "jpeg") 3. All of the formats -> user option =3D=3D nil Eli> I'm okay with having C-y select one format, if we can come up with Eli> some reasonable default, but we need to discuss the algorithm to Eli> arrive at that default. And if the suggestion is to let users wri= te a Eli> function to make that decision, then I'm squarely against that, Eli> because providing such functions is the job of Lisp programs. I don=CA=BCt think putting a single format on C-y works for case 2. I guess we could pre-populate the future history with one or more formats, but I think the user option would work better. The algorithm would be 'select all the formats in the available list that are in the user option. If that results in an empty list, offer the original list. If it results in a list that has one element, use it, else offer the shortened list' Eli> And no one has explained yet why I would prefer PNG to JPEG or vice Eli> versa, btw. The usual choices I'm familiar with is whether or not= to Eli> preserve typefaces, colors, and other fancy attributes; regarding Eli> images, there's just a decision whether you want to paste the mate= rial Eli> as a picture or as some kind of text, whether rich or not. So the Eli> background and the context for this request is still not clear to = me. I can definitely see a use for case 1 above: "don=CA=BCt bother asking me, if png is available just use that". Robert --=20