From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.devel Subject: Re: yank-media: allow users to limit image types that can be inserted Date: Mon, 23 Sep 2024 20:44:19 +0530 Message-ID: <87r09awgfo.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> 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="7892"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , pinmacs@cas.cat, emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 23 17:14:54 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 1sskm6-0001yF-Ku for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Sep 2024 17:14:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssklg-0003uz-4a; Mon, 23 Sep 2024 11:14:28 -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 1sskle-0003uq-Ul for emacs-devel@gnu.org; Mon, 23 Sep 2024 11:14:26 -0400 Original-Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sskld-0000rV-EE; Mon, 23 Sep 2024 11:14:26 -0400 Original-Received: by mail-pj1-x1044.google.com with SMTP id 98e67ed59e1d1-2d8b96c18f0so3572888a91.2; Mon, 23 Sep 2024 08:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727104463; x=1727709263; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=27ue3lUqtoL6XsB3e8+bxSkJF9MuP/vk8qM9yLMsf7g=; b=nQIs99Kt13ETQiyRgq/hmdpDq/d+gSMDCaLSYjcc7yUIpvWEtNWeR3wyofn5yASmUn IAfR1Ax+pD+MZg84efGp1jZDG9g90CgIfSbJ80kTQaViHMKU6fKnrqAWxTT/0pHOP3cI tWaPb8aV7Hsl+SIa0+Pf+INirhrSMXO9jaaG9waUhPy1Nf4mQs781hAZceNsDctQGOHG Ub1I6+lCdBw93PsMfjpygu8FFK5oSF/d5E8ui567b7oGcwQueTTXku9Dtz8rI0ff+f+7 DUseuz5Eua+NOnRPm12DI3DI/VvzSz7uKpmm/7qCEShB9V+ZMvA+cVc/KUbM/o/87os7 Uvlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727104463; x=1727709263; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=27ue3lUqtoL6XsB3e8+bxSkJF9MuP/vk8qM9yLMsf7g=; b=ZDLpa3EYXLrNMTXdd781Kvf1DcbciN7ke5sIHcxgzKWNHu+Eh1ZZ6wH2LnVKyu6Yrr 9eW0diT6KmN8IZ5vbq47xmAeF/IDmZcex/qURa9c+h34mc0fzn0YxF28HW0N+1xycdD4 /YGeWPmOhkfA0qzWMYkBkAPlQX2O+MegxlhPqBNALenulizQjq+Q0gNy+D44J4QDOouv /a498isOPvoDJO7TfItB7blrh4CpYooVs5ab2qUOEkuMd/DYQISSTf0afJFw/I/hxqxP fg24Mgd+mK006fj4DJSnv/xXRRqDPWY+OKrzXOT9/LSgwmP659+PXBzxsQCqnzOoCesg ugzQ== X-Forwarded-Encrypted: i=1; AJvYcCU23auOKVcxWGRVMAo9k1jE9i7ijHpoPc/Dw5C0943TdXIGoewaWdATpRQz49YM/nucoKVUs5Egbv3Zuw==@gnu.org X-Gm-Message-State: AOJu0YyFTtffOfIGn4sdge+6jxH/d43t6vrIhnhC/Q9wOP2tJEk3TU5O pwckc6Jn225/OosPyLu23i95KxkGY2voJfzLUP+Ow/+5R6kEH2Lm X-Google-Smtp-Source: AGHT+IFPorrtDzHEUKa29yHqS4r90Prt7OkTRPGWpILyOfT2La4hrftgFfLBZHkTJn5mqX+GqAv33Q== X-Received: by 2002:a17:90a:b310:b0:2dd:6969:208e with SMTP id 98e67ed59e1d1-2dd80c05478mr14552998a91.3.1727104462960; Mon, 23 Sep 2024 08:14:22 -0700 (PDT) Original-Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ee7c034sm9745226a91.5.2024.09.23.08.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 08:14:22 -0700 (PDT) In-Reply-To: <87frpqflv4.fsf@gmail.com> (Robert Pluim's message of "Mon, 23 Sep 2024 17:09:03 +0200") Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=visuweshm@gmail.com; helo=mail-pj1-x1044.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:323965 Archived-At: [=E0=AE=A4=E0=AE=BF=E0=AE=99=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D =E0=AE=9A= =E0=AF=86=E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0= =AF=8D 23, 2024] Robert Pluim wrote: > Eli> The issue at hand here, AFAIU, is not the UI, but how Lisp progr= ams > Eli> (and Org in particular) can control this. If the issue is the u= ser > 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=CA=BCt control this: it has to register for "image/.*" > because it can=CA=BCt 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.