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 17:30:53 +0300 Message-ID: <86setqfnmq.fsf@gnu.org> References: <79fc91f3-c2c3-44db-9817-595808917f26@cas.cat> <86ed5ahb08.fsf@gnu.org> <87zfnywki8.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="33134"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 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 16:31:39 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 1ssk6F-0008Sr-5t for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Sep 2024 16:31:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssk5Z-0006mX-78; Mon, 23 Sep 2024 10:30:57 -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 1ssk5X-0006mM-OW for emacs-devel@gnu.org; Mon, 23 Sep 2024 10:30:55 -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 1ssk5W-0004IV-VS; Mon, 23 Sep 2024 10:30:54 -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=TViVVW9+LIPW6oE9KqfM1Z5BxMUYlpKpFZQwTeaFOG8=; b=paKPDE1BcKODK7j4ZNJ+ fTFvoTDBVSJkN2TBWKZHxjgkdbQbEfme9pafK13HZAJxupKitGY61vuzXq1cmaSERTWwaVHiNkQve /qrQ4Uj/UAvmEptf8fcWunP9KlRWW7e8cA1A97w8fNuqL3T4HLrC2R9YxuUlxZvW5h2TMzN+fQzjL edXiMNPQ2v6D35FPnp5tyE4HPY7Qsmhd4pWyv8LNOkuOYNLa/5Hs57OW63yD69ZHFT4n8Y4edZ7vz Q7Fv6wB2J1mERZny1DCMjIVHTgyKy+/jkPgdladgubwz0ZEuNv0jTkvcxTO2Y0yfLDZ0E8y7bVuX/ 7ILpIEdjtdznqw==; In-Reply-To: <87zfnywki8.fsf@gmail.com> (message from Visuwesh on Mon, 23 Sep 2024 19:16:23 +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:323961 Archived-At: > From: Visuwesh > Cc: pinmacs , emacs-devel@gnu.org > Date: Mon, 23 Sep 2024 19:16:23 +0530 > > [திங்கள் செப்டம்பர் 23, 2024] Eli Zaretskii wrote: > > > Isn't this already possible by using yank-media-handler to register > > only the handlers the Lisp program wants to handle? If that doesn't > > fit the bill, please explain why. > > When you copy an image in Firefox, it puts both image/png and image/jpeg > in the clipboard. The Lisp program could register a handle for > image/png but if the non-Emacs program puts only, say, image/jpeg then > we wouldn't be able to handle the image anymore. For the most part, the > Lisp program wouldn't care about the specific format of the image but > the fact that it is an image. An user option that would tell the > preferred type in the presence of _multiple_ matches for the handler's > regexp would be nice to have. IMO, for users we already have what is needed: when we detect several formats, we show them to the user and ask him/her to tell us which format he/she wants to use. The issue at hand here, AFAIU, is not the UI, but how Lisp programs (and Org in particular) can control this. If the issue is the user interface, then I honestly don't understand what issue is being brought up, because in that case we already have the correct and comprehensive solution, similar to what other advanced apps do in these cases.