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: Tue, 24 Sep 2024 14:18:08 +0200 Message-ID: <87jzf1dz3z.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> <86tte5e1c6.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="13317"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pinmacs , visuweshm@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 14:19:10 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 1st4VZ-0003EL-NV for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Sep 2024 14:19:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st4Uj-0003Jk-9G; Tue, 24 Sep 2024 08:18:17 -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 1st4Ug-0003JM-7T for emacs-devel@gnu.org; Tue, 24 Sep 2024 08:18:14 -0400 Original-Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1st4Ue-0002fm-Fa; Tue, 24 Sep 2024 08:18:13 -0400 Original-Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-374c4c6cb29so5431226f8f.3; Tue, 24 Sep 2024 05:18:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727180290; x=1727785090; 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=B9Bb/RkXbabI5bQje/O01cx5bizayR4oVDCwtPty7TI=; b=bTvoMH/T+JGOBTMYSgOKP7mZWt9waUOjynSIfCqueZgDTzr8QIjBzo4CuW+Jj5qtZx 7OTWPUet8gH6Ewhkh0eUAWEXjMs7gh9ZVr7EZEc1J5aXxT7/TLUGXVErk1RmsPYAqYZF U9yUrFAi7eHWWDqX1FSFuPU/F3FHXl8YdFLiiQonTGgTrQs81+oN61ooju9Wx68rAZ4+ 8h/GWBdr4WHdOMoWFjiwdilOX6jDRWKmqduyAB9xeV6wyHiw1PwL7ceAy48v5ll9QaR/ uf5+9lK8S2i0bg2myzZeWVAWyC1gMlK10yhRass6mkybkKV1jTEqeITvM+HFmU31j+nA nV7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727180290; x=1727785090; 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=B9Bb/RkXbabI5bQje/O01cx5bizayR4oVDCwtPty7TI=; b=TX8QujxW0O2UkyllZ70Dp19LklDtY8jOXQtFakDaGBufnArNFpOvNZjXxgrEpFIZsJ rOI5lMmz9BgjPpzjpbjotv/kfpvAap1N7dkdws59BI204KOJn2wd6Xm9HOrnnouCQI9p heQCbIBN6spVapgnxBZX9OMe3VNpCh/3SMklrpgzaJNpFCx3k4+/TDd1dVpbAW9UqXCt HSjUFrOBYG48DxpwvMALTDwRCTkzgVXxtp6PDvGiEGQIP5z5gHIgFJ84V5alSdA2pgl9 wiAsEu4Dzg9Bv3ndsq+N0AF0R8vplyAa6CdZRpLHEtHuMSG4IDU21c+CHoRl3SsMZtTs V+9w== X-Forwarded-Encrypted: i=1; AJvYcCVyj2vRy9j+RJfUXfLEyTouxVOfdX+TlUmAj1gLhUqTShgwHNZQVDd2vfsWvmRABzwrGRq3CJmb7pZgJg==@gnu.org X-Gm-Message-State: AOJu0Yw7wp2tVdwawtzL9BhV6+CVbAB8h7pMI0VF69GzDGvLGz0pIhVi LqLfn4mUiReP90KOFufYHnGyh53JSsAfdNz+FATx6ZWILoIXBmJ6LMIgcw== X-Google-Smtp-Source: AGHT+IHJOCqwsOgZKDvklNVOJzixAt7jjx0D0OV59E1GVDIglCH4g8e/A93R2YUjbl6ngSPh7FnEEQ== X-Received: by 2002:a5d:5501:0:b0:374:c3cd:73de with SMTP id ffacd0b85a97d-37a422ea0a4mr12917626f8f.35.1727180289821; Tue, 24 Sep 2024 05:18:09 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb51:84a5:f5c1:da9c:5ef]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37cbc2c212csm1447308f8f.40.2024.09.24.05.18.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 05:18:09 -0700 (PDT) In-Reply-To: <86tte5e1c6.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 24 Sep 2024 14:30:01 +0300") Gmane-Reply-To-List: yes Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=rpluim@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:324024 Archived-At: >>>>> On Tue, 24 Sep 2024 14:30:01 +0300, Eli Zaretskii said: >> Date: Mon, 23 Sep 2024 18:08:58 -0300 >> Cc: rpluim@gmail.com, visuweshm@gmail.com, emacs-devel@gnu.org >> From: pinmacs >>=20 >> Eli, I think we can solve the three situations described with follow= ing=20 >> algorithm/idea/inspiration [1]: through a configurable variable=20 >> (yank-media-image-types ?). That would allow you to be able to selec= t=20 >> among all options (that for certain cases could be interesting, say= =20 >> "expert mode", I know what I am doing, verbose mode, etc.), and also= , a=20 >> way to filter out certain candidates based on what you need. >>=20 >> Making that variable equal to nil would be as it is now, and configu= ring=20 >> it to "image/png", would only select one. I think others were thinki= ng=20 >> about a regex. As you wish, I only need some sort of filter, and I d= on't=20 >> care too much on the detail of how it is configured. Eli> First, I think a simple defcustom will not be enough, since changi= ng Eli> the list of handlers must go through yank-media-handler. There=CA=BCs no need to change the list of handlers. What the user option would change is only which type(s) are presented to the user. The mapping from the selected type to the handler doesn=CA=BCt need to be changed. eg org uses the same handler for all image types. Eli> More importantly, I still don't understand the rationale and the u= se Eli> cases where this could be useful, and adding yet another user opti= on Eli> without understanding its need and intended usage is not something= I'd Eli> like us to do. Emacs already has way too many user options. When writing technical documentation, often you want to include screenshots, eg of a browser window. On my GNU/Linux box, `yank-media' of such a screenshot offers jpeg, png, or webp as formats and I have to choose which one I want every time. If I could say "use png if available" via our proposed user option, that would save me time and would interrupt my flow less. Or if I was yanking text from a word processor, I could say "prefer plain text" since I don=CA=BCt want to deal with any potential html markup. It=CA=BCs analogous to the situation where people send multipart/alternative emails with both a text/plain and a text/html part, and the recipient specifies which of those they=CA=BCd prefer to see. Robert --=20