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: Sun, 27 Oct 2024 12:09:31 +0200 Message-ID: <86v7xdamck.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> <87ikulwsd6.fsf@gmail.com> <86o74ddzxp.fsf@gnu.org> <87msiqvkph.fsf@localhost> <86ed42bs03.fsf@gnu.org> <874j4yot7x.fsf@localhost> <861q01c3h9.fsf@gnu.org> <87wmht3n17.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="10648"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, pinmacs@cas.cat, rpluim@gmail.com, emacs-devel@gnu.org To: Visuwesh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 27 11:10:21 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 1t50E0-0002ZE-Qn for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Oct 2024 11:10:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t50DI-0006dZ-Q9; Sun, 27 Oct 2024 06:09:36 -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 1t50DI-0006dQ-1g for emacs-devel@gnu.org; Sun, 27 Oct 2024 06:09:36 -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 1t50DH-0000sW-2G; Sun, 27 Oct 2024 06:09:35 -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=U1AKVmR7okni+zdwytTVAeHGa0eiCOUrzNWbjKBiSbE=; b=KcBCjfRYHUTBEjEPS9r/ SVA5eCnPV6kEb1n64GKJDGh6tE9Z18XHbyfwEOoDTb1v97Z742So4Pgm7EVDiNj2H+IZptQWQirUu d5GJPT0uG8tM1cX07sIU3rUY5D4V7mlvoQmeFUo2dqSTsFev5pcs4RCOjHvHuhXugv/rKkAQ+NMlP kbom2mHtaHZxmD1key3Jw15NywXOmKRk78YQhUnddW9sFjVkJsh7p8ngy9A8do7RTJO/2cqZ45Jfm 2EJTlph3b6Omm0HMiIbJ7Fa+rpAiiN6IqHnolOud9l4O7S+PWPeqBT3xnXdHyMwGGT+erpMv153EO AVjBJUlEzGrRdg==; In-Reply-To: <87wmht3n17.fsf@gmail.com> (message from Visuwesh on Sun, 27 Oct 2024 15:06:36 +0530) 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:324882 Archived-At: > From: Visuwesh > Cc: Ihor Radchenko , pinmacs@cas.cat, > rpluim@gmail.com, emacs-devel@gnu.org > Date: Sun, 27 Oct 2024 15:06:36 +0530 > > [ஞாயிறு அக்டோபர் 27, 2024] Eli Zaretskii wrote: > > >> From: Ihor Radchenko > >> Cc: visuweshm@gmail.com, pinmacs@cas.cat, rpluim@gmail.com, emacs-devel@gnu.org > >> Date: Sun, 27 Oct 2024 08:17:22 +0000 > >> > >> Eli Zaretskii writes: > >> > >> 1. clipboard contains 2 MIME types: image/png, image/bmp > >> 2. clipboard contains 1 MIME type: image/png > >> 3. clipboard contains 1 MIME type: image/bmp > >> > >> We want to handle all three scenarios in the following way: > >> 1. Select image/png (prefer it over image/bmp) > >> 2. Select image/png > >> 3. Select image/bmp (there is no image/png that we would prefer otherwise) > >> > >> In all three cases, we do not want to prompt user about mimetype choice. > >> > >> How can we do it using the existing Elisp API? > > > > Examine the available TARGETS, then bind > > yank-media--registered-handlers to the appropriate value when invoking > > yank-media. > > Would that not defeat the point of yank-media, which is to present a > simple, common interface to the clipboard data to major-mode authors? Which part of the above would "defeat the point of yank-media", and why? > This approach also means that we would end up with org-yank-media, > html-yank-media, etc. which does not sound better. If Org has its own ideas about what's best for the users in some situations, and if the users agree with that, I don't see what is wrong with that. The common interface presented by yank-media to major modes is there so that major modes could use it in whichever ways they think is best for their users. So I see no problems in major modes deciding to prefer some handlers over others, not in principle.