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:36:42 +0530 Message-ID: <87v7ymwgsd.fsf@gmail.com> References: <79fc91f3-c2c3-44db-9817-595808917f26@cas.cat> <86ed5ahb08.fsf@gnu.org> <87zfnywki8.fsf@gmail.com> <86setqfnmq.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="16848"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 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 Mon Sep 23 17:07:46 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 1sskfC-0004IZ-7y for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Sep 2024 17:07:46 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sskeT-0005vr-AL; Mon, 23 Sep 2024 11:07: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 1sskeR-0005ml-Et for emacs-devel@gnu.org; Mon, 23 Sep 2024 11:06:59 -0400 Original-Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sskeP-0008Ks-P1; Mon, 23 Sep 2024 11:06:59 -0400 Original-Received: by mail-pl1-x644.google.com with SMTP id d9443c01a7336-2059112f0a7so39711415ad.3; Mon, 23 Sep 2024 08:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727104007; x=1727708807; 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=Y8OM5BYf6zzGd29GZq75JNkRiikKoZul6tr6TH6BNH0=; b=LxVPiRiO4rINTdGAjKOehuTD3Rk549Zh3yhOD4fY9U0PmHdN5F2GU7Or9Pd3CH0BRK l4MVeTg4tFrmqN2z0ekRwby32eNKAlP3efy18ow/KGM9qb/9UwFi0oBMaK/+nI/mDcQe OtlXR1RIcxoUXw52nXdj4rb//Fl0LDqyi4e2fdiZN5VKjToYaPCIxxlmpl2sowA+2OmT aPilI/U9uiQTA9uU5Yceg7RQYqUxXXdVB5ztvgJpGze6eEEEmFTLCstM0WFvKPFF4DcD qgvYrmQSd+5UdKYERISxUNXI4GY4Oh3AJkRmslu5kWyM0WqJvIlF00WNJ+wN9bmijJmC Gz5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727104007; x=1727708807; 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=Y8OM5BYf6zzGd29GZq75JNkRiikKoZul6tr6TH6BNH0=; b=YH7kRvRMSE/cn8EK27Fi0d5vKyneDRrHtRgKKC/jHQ7NW+PwgOlt0ZlXlIbUK7ZrNZ ms6lmf9eh8MPUoTqcU0KqjLOl+rESUkR4FU341pCoLkLc+3s+TsjYomq/sd0QlHX44jF tsYPAV0e1r7PWRFpwZpmXx2YRUmW2H8k4yVASpV/GbtsW0o/rL/I2GiWgd5O+RGRhL0y wizvwGSVlsFRjci/g0ULjUvm3WpDrgtf7UxNQkSh+X4wOE7EAqxszswyI+NYe4SMdrWD EmacwzwObAuesX40mJ+KRUJ5vpHTBH0e4Kue9dFYK+oEelAE9ot3lvWlu27qmFa/OjIl NQpw== X-Forwarded-Encrypted: i=1; AJvYcCWZ95R7DX3AUk2vA/S4P5oWDAlH05uuQPcsDwn49Ti9QEtSUXVfhdpwzHHM+LRhRpXPlp24rvqJha2OQA==@gnu.org X-Gm-Message-State: AOJu0YwOcU/ybJapv96BxTfXy2RjbOoaQCPaiN1HFd3lze98+F5CLVX8 Ce/w6xaAnFQqXQYd1Th0UwYWoKojx2IwvdjVHX6jEq+T89mZAQ52QwbEctlL X-Google-Smtp-Source: AGHT+IEYpM9ih0lPyVpKnG+rdC07RwUa3aufCEpEo52EMcqu4wkmRG5ghxQD/kCGBH1qY5ByEvujrA== X-Received: by 2002:a17:902:fc84:b0:205:9112:efc7 with SMTP id d9443c01a7336-208d83ac37amr189705355ad.30.1727104006766; Mon, 23 Sep 2024 08:06:46 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2079475df17sm133764945ad.298.2024.09.23.08.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 08:06:46 -0700 (PDT) In-Reply-To: <86setqfnmq.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 23 Sep 2024 17:30:53 +0300") Received-SPF: pass client-ip=2607:f8b0:4864:20::644; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x644.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:323963 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: pinmacs , emacs-devel@gnu.org >> Date: Mon, 23 Sep 2024 19:16:23 +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 >> > 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. >>=20 >> 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. [ IMO also, the current interface is fine. ] > 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. AFAIK, the OP wants to skip Emacs asking for the preferred format and instead let her choose a specific format if already present. The goal here is to keep the chit-chat with Emacs to a minimum which I understand since I initially wrote the yank-media code for Org to keep manual intervention to a minimum when linking to images, etc.