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: Tue, 24 Sep 2024 16:08:21 +0300 Message-ID: <86a5fxdwsa.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> <8634lqfcaf.fsf@gnu.org> <86tte5e1c6.fsf@gnu.org> <87jzf1dz3z.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1326"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pinmacs@cas.cat, visuweshm@gmail.com, emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 24 15:13:12 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 1st5Lq-0000Ai-52 for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Sep 2024 15:13:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5Jw-0003u7-2S; Tue, 24 Sep 2024 09:11:12 -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 1st5HN-0000n2-Oy for emacs-devel@gnu.org; Tue, 24 Sep 2024 09:08:34 -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 1st5HM-0000w2-TR; Tue, 24 Sep 2024 09:08:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=/O5VETSd/3ETukF62vgmQJ8lVYtc4N3JVON5ExiOPM0=; b=nS/vMJ0/XY4K6AYAzjB1 E6MV9BE+pPFe96lpnwEHRSD+LvM3lhA3qYy5gkNDhQBqUAivQxAGqb9L6OMYCg1rX4iX+CQOS342m RBc2ooKcCyd9/5WvATPTxlQtbC6nXRI4VTXMqYsm1Yw6MaJ+KxS80LThWdlkqHJkNJNwd44Aol1YV R3ei1x7bmPoUEozdeODbQQF5tKGEqXpeWArC8TAX9Ws+GfzREKXt3v1Whc9HvHhJuZXlmEE2yYPu1 rc4IEzGYxMFCjggLPFTTZt2YFPQcu3B9zCSEoolrAOQAW3aJbNPb9kRIvrzMKWk6xb4upvNFr0ch/ bz/UHq/yaBgHBg==; In-Reply-To: <87jzf1dz3z.fsf@gmail.com> (message from Robert Pluim on Tue, 24 Sep 2024 14:18:08 +0200) 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:324031 Archived-At: > From: Robert Pluim > Cc: pinmacs , visuweshm@gmail.com, emacs-devel@gnu.org > Date: Tue, 24 Sep 2024 14:18:08 +0200 > > >>>>> On Tue, 24 Sep 2024 14:30:01 +0300, Eli Zaretskii said: > > Eli> First, I think a simple defcustom will not be enough, since changing > Eli> the list of handlers must go through yank-media-handler. > > Thereʼs 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ʼt need to be > changed. eg org uses the same handler for all image types. So this option can only be used to effectively disable some handlers, and cannot be used to _add_ handlers? Does that make sense? > Eli> More importantly, I still don't understand the rationale and the use > Eli> cases where this could be useful, and adding yet another user option > 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. And this is a frequent enough situation to justify a new user option? How much does this happen to you when you write documentation? Moreover, why would you want to prefer a specific image type in this case? I think this case is exactly the reason for having a command that automatically chooses the most appropriate image format without asking you. > Or if I was yanking text from a word processor, I could say "prefer > plain text" since I donʼt want to deal with any potential html > markup. Here' too, it should be possible for Emacs to choose the most appropriate format automatically. For example, if yanking into a plain text buffer, prefer plain text; when yanking into rich text, prefer text with faces, etc. > Itʼs 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ʼd prefer to see. Yes, and how many times you want the part that was not the one shown by default? In my case, this happens extremely rarely, almost only when the default format has some problem, like is unreadable for some reason. Bottom line, I think we will be much better off if we offer a command that automatically yanks the most appropriate format. But we are already going in circles, so I hope someone has some new arguments and use cases that were not yet brought up.