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: Tue, 24 Sep 2024 10:30:49 +0530 Message-ID: <87msjxwsqm.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> <87r09awgfo.fsf@gmail.com> <86h6a6fjki.fsf@gnu.org> 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="34154"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: rpluim@gmail.com, pinmacs@cas.cat, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 24 07:01:53 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 1ssxgP-0008lt-BA for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Sep 2024 07:01:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssxfZ-0005ou-2i; Tue, 24 Sep 2024 01:01:01 -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 1ssxfW-0005of-6c for emacs-devel@gnu.org; Tue, 24 Sep 2024 01:00:58 -0400 Original-Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssxfU-0006fp-OJ; Tue, 24 Sep 2024 01:00:57 -0400 Original-Received: by mail-pl1-x641.google.com with SMTP id d9443c01a7336-206bd1c6ccdso48495455ad.3; Mon, 23 Sep 2024 22:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727154054; x=1727758854; 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=Rs397REikLRqnihi3vGOgRmqn39lJmnVHFZzW7yK5Vc=; b=GO2PT+nblU9P74F53UQVzvRlxIA5x4ho49KcGHtxF7abDcR3KQj3+iXja8sswu1ePg BoxmSIGSQduxGBEnzAWW3Lkg/qYlEbjKtf2rOOhooaNzqfEZZN8on8GG5G0B+d31uGCt KXfjua4rbgGzj9gnKmACSEcSOqy1DULibVHPoCfWnHqZBwLPxHj9QkGjgbKBIjnArL9Z GAnBMMJvUTD03FZHnsj/Jo5DSa2EyFrq8JDLveUjHzlTX4r1Fq669DEvL/1TculllO2H BwcKOUHBL5x2vISA3bncHJ5+Ahl9Ku+m4EABxbWVp4+QoiO1TEb68to1f53gbz1gP42b XCcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727154054; x=1727758854; 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=Rs397REikLRqnihi3vGOgRmqn39lJmnVHFZzW7yK5Vc=; b=ngaHB9ODIiNdIJXkP+cWqZ7i6Z56eDb0v4pAEUjKCTgLLbCmkfoBKcySnuBL4/e8aK +axYPeo52nGrsEzrDHArCs7VDRBjzu9irfO8FLOjFalWKsHrGaim7/qNiWqzCqrn7XZD 493OT38H5ftGK1F9hJObDQxXYH9+w6/NpKJQji0mq3ivX4kDxD3ZR3fJrLZuYs0HUwWf y9HGAq0tfznGZERFiKp4sK4GYua734fvpgw0HUC6PIsPw4v8T1z2tNH3tYfAUJHuD8Zw 3mGgT+N736u9rBEBkPOtakFcfd+UXlB6KIexDAtjKfGQdiEVmMLBJJ405+YqU4uMsfHK q73g== X-Forwarded-Encrypted: i=1; AJvYcCW143sDb8P/i9/3Vn+oHjTcR78o93j+7YUdv4rps3NLKEhE5ePh64fcepyRA+b21mUGbS1uCztf/Vp2qA==@gnu.org X-Gm-Message-State: AOJu0YzFdZ1rtwPJ3y+3ZgX2bBZHNnZXzroiJtZA/XEPxa71tifkYuKK ywCIpspv2nXPZfeJT180wAbt4kBMUcJW+JRZoJHY6RAbZ5v9AN7f/HcFq45l X-Google-Smtp-Source: AGHT+IFY7FtCGW+RaL7UIYvtSILG9Nr0QZca9Wk8dly8q1hCzNDP0JeXJNc3fj+bRpy0KWau8hPOjg== X-Received: by 2002:a17:902:f542:b0:206:b250:1e1 with SMTP id d9443c01a7336-208d8441a73mr231778935ad.45.1727154054256; Mon, 23 Sep 2024 22:00:54 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af16df873sm3403955ad.7.2024.09.23.22.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 22:00:53 -0700 (PDT) In-Reply-To: <86h6a6fjki.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Sep 2024 18:58:37 +0300") Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x641.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:324006 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] Eli Zaretskii wrote: >> From: Visuwesh >> Cc: Eli Zaretskii , pinmacs@cas.cat, emacs-devel@gnu.org >> Date: Mon, 23 Sep 2024 20:44:19 +0530 >>=20 >> [=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: >>=20 >>=20 >> > Eli> The issue at hand here, AFAIU, is not the UI, but how Lisp pr= ograms >> > Eli> (and Org in particular) can control this. If the issue is th= e user >> > Eli> interface, then I honestly don't understand what issue is bei= ng >> > Eli> brought up, because in that case we already have the correct = and >> > Eli> comprehensive solution, similar to what other advanced apps d= o 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 gue= ss 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. >>=20 >> 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. I was replying to this part: The issue at hand here, AFAIU, is not the UI, but how Lisp programs (and Org in particular) can control this. My point was that there is little control over this UI from the handlers type since the handler cannot filter the types available.