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: Mon, 23 Sep 2024 18:58:37 +0300 Message-ID: <86h6a6fjki.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> <87r09awgfo.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="29714"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, pinmacs@cas.cat, emacs-devel@gnu.org To: Visuwesh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 23 17:59:08 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 1sslSu-0007Z6-RX for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Sep 2024 17:59:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sslSU-0001BC-Hi; Mon, 23 Sep 2024 11:58:42 -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 1sslSS-0001Aa-Ix for emacs-devel@gnu.org; Mon, 23 Sep 2024 11:58:40 -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 1sslSS-0006LE-43; Mon, 23 Sep 2024 11:58:40 -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=kLjQQnj1YL3Yjb/EKVqfLWUs+AEiGWrvyPgfJxJ0Nuk=; b=bdmlasbX/QVSWsCIERxZ GY1vasUIF0Tez6l4gzKPQT4mb4xIH2meT/ly20XXkSw4acUSRDnwpDRXwUtAlwi5vf8eaYw7To41I I3eU06G9bVN8JHEijzft9k07L6iljmX34LC+mfkkXTHgYJZK43Syp8tSxq7sxtlForgUEzahIN5Uu CAIPjKdtDiqjzmaqI+VJ+eHZ+3Zt/AtiRHQ7JDmDXeS/o2W6/3vrK+76iJKUHSbuj+FHrYgjD9+Gx dHrm5r5NMAufZu/q5QyunV0va72uiJ8kYjL7gsNo5TWExcKFIgGn+nNgFtrf85RXd/x24rNvwTqdG TxxX9qyNjcsfPg==; In-Reply-To: <87r09awgfo.fsf@gmail.com> (message from Visuwesh on Mon, 23 Sep 2024 20:44:19 +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:323972 Archived-At: > From: Visuwesh > Cc: Eli Zaretskii , pinmacs@cas.cat, emacs-devel@gnu.org > Date: Mon, 23 Sep 2024 20:44:19 +0530 > > [திங்கள் செப்டம்பர் 23, 2024] Robert Pluim wrote: > > > > Eli> The issue at hand here, AFAIU, is not the UI, but how Lisp programs > > Eli> (and Org in particular) can control this. If the issue is the user > > Eli> interface, then I honestly don't understand what issue is being > > Eli> brought up, because in that case we already have the correct and > > Eli> comprehensive solution, similar to what other advanced apps do in > > Eli> these cases. > > > > You have to register the yank-media-handler before the yank-media > > call, so org canʼt control this: it has to register for "image/.*" > > because it canʼt know what formats will be presented to it. I guess it > > could have a user option to filter the results from inside its > > yank-media-handler, but then *every* package that wants to support > > image yanking will have to implement something similar: we should just > > implement such handling in the yank-media code. > > AFAIR the yank-media code, there's no way for the handlers to reject a > specific format. yank-media, the command, asks the user the type she > wants, _then_ calls the handler specific to that type. The handler > cannot influence anything during this interaction. This is true, but I don't see how it is relevant to what I suggested.