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 18:12:03 +0530 Message-ID: <87a5fxw7dw.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> <87msjxwsqm.fsf@gmail.com> <86plote02o.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="35325"; 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 14:43:15 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 1st4st-00092k-Ba for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Sep 2024 14:43:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st4rx-0002Z0-2E; Tue, 24 Sep 2024 08:42:17 -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 1st4rs-0002Yg-TC for emacs-devel@gnu.org; Tue, 24 Sep 2024 08:42:12 -0400 Original-Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1st4rr-0005ix-9m; Tue, 24 Sep 2024 08:42:12 -0400 Original-Received: by mail-pl1-x642.google.com with SMTP id d9443c01a7336-20792913262so64824435ad.3; Tue, 24 Sep 2024 05:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727181729; x=1727786529; 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=ubFF3auhypsWh9z/YTeCUDKgh8bd4vfj6Q24Jb/2bEw=; b=NHA9R+d+DgrsNhbcg2Kkq93Svr3X3KNnFGhXdkKnXi01/ORVzLZ07ElRBJJ3QdUzjJ IpNxDPtlcr5hcsiLa3DAjvnIRaSnS64jGkmzKTMAxqKAIbKZ9rxqN9zfZaDgvuzdhJIq 73fQX6yLGY6tMSKzS4h4Enobl47oVzH2BG0BRP/kKXtBsOIdl2gxLpr9PNXDs6Ljteb/ /JaRR948A+LKcMkP6K+oIxTYPM6YVLqlTUw+kRXZFrVztBVYI4DIwpZzHWRT49A0+/Ow RhBIfuMCLfotOASGrU8Q2M8Zk6Umtd/bqHWhnuPnukn48kVXnWqrpgenZyKrshibHE2k vTVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727181729; x=1727786529; 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=ubFF3auhypsWh9z/YTeCUDKgh8bd4vfj6Q24Jb/2bEw=; b=Xt4MCtCOC40mVqMUL9xPruAesreGRRaTkbzslz88YmyrExSbW+r7CobegDoCVUBfSf wJfXkXZ5zYgzHSNqJCKxbLoyeBlPDVg0t/YiHYv/dcbsfLjwHIreRblXVHCoaM1EBgya +VGsX1uHjA75kb+LDfUpYdDJUyzH79RhqTP2eb785Lrg3lh3NZLbm+VxvPaw1rW7Ur6h s70/RJUSFWmY2Cb2hXE6YYTgsUvK6BDCcTWC4abV3Xreqvgpj4qcJgw8+ngijQFmIi+i EGrDLudpqeoki4dVVqzDZe9OfwT8bCySXTLqLRGWDooWL31A0+rmPl52DH5mwQgys96I BYpQ== X-Forwarded-Encrypted: i=1; AJvYcCVKT5GEYYMa32XotkOqwb1G1iVJp3q5p6nzwriGmq937V7tTUOQwFA0eCCfewiZxcYXvitUeBz2k99ulw==@gnu.org X-Gm-Message-State: AOJu0YzmmU38ABzF2SHtDXL3i8LmkcBXj9YLwOTOikswKteoNlh/lk0o dGX+AHV2+ZO7zMIPK3PZuy2eX71pDHg8YX180CgMv5w1kmcaHVw+hqVeeANS X-Google-Smtp-Source: AGHT+IFp7DQz0qK9W5btjBpGPsIT+5IkyP4o4z3PU+zvaAIjuyk8PiVJN4POczWyJu6jeIY51zlbWA== X-Received: by 2002:a17:902:f54e:b0:205:721f:ec6f with SMTP id d9443c01a7336-208d83ca200mr238316365ad.35.1727181728726; Tue, 24 Sep 2024 05:42:08 -0700 (PDT) Original-Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af16df902sm9752605ad.38.2024.09.24.05.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 05:42:08 -0700 (PDT) In-Reply-To: <86plote02o.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 24 Sep 2024 14:57:19 +0300") Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x642.google.com X-Spam_score_int: 22 X-Spam_score: 2.2 X-Spam_bar: ++ X-Spam_report: (2.2 / 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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:324025 Archived-At: [=E0=AE=9A=E0=AF=86=E0=AE=B5=E0=AF=8D=E0=AE=B5=E0=AE=BE=E0=AE=AF=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 24, 2024] Eli Zaretskii wrote: >> From: Visuwesh >> Cc: rpluim@gmail.com, pinmacs@cas.cat, emacs-devel@gnu.org >> Date: Tue, 24 Sep 2024 10:30:49 +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] Eli Zaretskii wrote: >>=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. >>=20 >> I was replying to this part: >>=20 >> The issue at hand here, AFAIU, is not the UI, but how Lisp programs >> (and Org in particular) can control this. >>=20 >> My point was that there is little control over this UI from the handlers >> type since the handler cannot filter the types available. > > OK, but then my point was that a Lisp program _can_ control this by > customizing the list of handlers.=20=20 Perhaps, we view the user option in different lights. I see the user option as a knob to narrow down the available types to a few (or one) types that the user personally wants. > It could even replace all the handlers with its own single handler, > which could then call the other handlers according to some logic, thus > working around the fact that there's no mechanism currently for a > handler to refuse to handle the type for which it is registered. If you meant to say use ".*" as TYPES in yank-media-handler that wouldn't work because the user is asked before yank-media, the command, calls the handler with the mimetype and the clipboard data. If you meant something else, then sorry I do not understand what you wrote. But your point has gotten across to me, I think.