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: Sun, 27 Oct 2024 15:06:36 +0530 Message-ID: <87wmht3n17.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> <86ikumfjri.fsf@gnu.org> <877cb2fj0c.fsf@gmail.com> <86cykufhw7.fsf@gnu.org> <3a015d0f-549a-401f-be1c-651c9dbd5d9a@cas.cat> <8634lqfcaf.fsf@gnu.org> <87ikulwsd6.fsf@gmail.com> <86o74ddzxp.fsf@gnu.org> <87msiqvkph.fsf@localhost> <86ed42bs03.fsf@gnu.org> <874j4yot7x.fsf@localhost> <861q01c3h9.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="11293"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Ihor Radchenko , pinmacs@cas.cat, rpluim@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Oct 27 10:37:30 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 1t4ziE-0002nP-5P for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Oct 2024 10:37:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t4zhW-0007hs-Br; Sun, 27 Oct 2024 05:36:46 -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 1t4zhU-0007he-4P for emacs-devel@gnu.org; Sun, 27 Oct 2024 05:36:44 -0400 Original-Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t4zhS-0006P8-II; Sun, 27 Oct 2024 05:36:43 -0400 Original-Received: by mail-pl1-x643.google.com with SMTP id d9443c01a7336-20cbcd71012so34739315ad.3; Sun, 27 Oct 2024 02:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730021800; x=1730626600; 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=yqLMi9dJGvRsGgP+y6lizI7PEDJT6n+ENZAqTryYFgM=; b=cvDJL3gv3VA+UrPv5LToH1bPyeihyxYiDE2/hvGa8HL3bZmQAoA0rb2DTnFczg9fmQ oaKQ+hUBFPPeGElbDUhQ5EeCS8dLHHtBKy7Kl4CnB3Wu2mzLvGf8ykAEG1cXpyer85CX IyObD/yoWffPRdrG8WXA5w1MWMcJ4aKfFIQJNGIkycZM/4Zkk43le/JK76+qS/4GMZ0e JDPH3B4p8BJ3yKpgfnPNt5YbCLd/RHG8rAsRR2sIc+YUNsxBd1QK5ca+oF2yesG/oT9r p/7CAXQieeEiTueuEQam9h/qOSnJCZ1H17HRpqyLHHpCYHmEKlAyIFdi0V1uitaSxJcR t3iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730021800; x=1730626600; 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=yqLMi9dJGvRsGgP+y6lizI7PEDJT6n+ENZAqTryYFgM=; b=m3msNwgCoH0vnvYw260CAHBbxwsdpi7tNMLWHp6yZ6Ug0SGfXoL2fsrStWnZQsSv8R TwR3Efq2iKrGSHkxgP5fbZWDzdF49N9UisXGhFBkTgasrFRHS6BKLpbb97fNakx2ZQDN B6YXP0B3wor6CPutyDYvLr5jBlVr0OWVDneug8Jvn98q6+LMm3QDyIQmAWgMgsgnnLyS ijnx/nZKc+f++N/lnhK2k5gdcpafK5FWqyxavPue6mf8+ynOycD+4auw+yq2WN6EQOyj pCPhPI1I6q+vaT4m7Ck25wh0X1l8Qbx9p/xayLJU3u7mCwQvMQYup6ckpqsDPj5JonP8 He4A== X-Forwarded-Encrypted: i=1; AJvYcCUKMHoUMroz1TJOwNyds2Aw6kzYdWlVLXl/DtFTlbhNf0//bCFXmO1c2uN8599f+r+9IAqPAmoLkh/RrQ==@gnu.org X-Gm-Message-State: AOJu0Yxq7ncJ8pmNWzimyWnYv57/a/+hpNcrLu+maVfL7ISfYonYkoqO 4kmOybwdH89LbTIJiWwF5YPBF2lE3OrSZWD10Uo1Hf7ADirwjwMYtnzrcQeW X-Google-Smtp-Source: AGHT+IElfA1l36AA6gd/ZrEVrWasgsvTqW886Y0iXiAGdfBI6IRmXB8EgsMEwyRPAW3HRjcUDzwvVA== X-Received: by 2002:a17:902:e5d0:b0:1fb:57e7:5bb4 with SMTP id d9443c01a7336-210c6c6b978mr53968875ad.37.1730021800132; Sun, 27 Oct 2024 02:36:40 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-210bbf44517sm33519455ad.58.2024.10.27.02.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2024 02:36:39 -0700 (PDT) In-Reply-To: <861q01c3h9.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 27 Oct 2024 11:14:10 +0200") Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x643.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, 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:324880 Archived-At: [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =E0=AE=85=E0=AE=95= =E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 27, 2024] Eli Zarets= kii wrote: >> From: Ihor Radchenko >> Cc: visuweshm@gmail.com, pinmacs@cas.cat, rpluim@gmail.com, emacs-devel@= gnu.org >> Date: Sun, 27 Oct 2024 08:17:22 +0000 >>=20 >> Eli Zaretskii writes: >>=20 >> 1. clipboard contains 2 MIME types: image/png, image/bmp >> 2. clipboard contains 1 MIME type: image/png >> 3. clipboard contains 1 MIME type: image/bmp >>=20 >> We want to handle all three scenarios in the following way: >> 1. Select image/png (prefer it over image/bmp) >> 2. Select image/png >> 3. Select image/bmp (there is no image/png that we would prefer otherwis= e) >>=20 >> In all three cases, we do not want to prompt user about mimetype choice. >>=20 >> How can we do it using the existing Elisp API? > > Examine the available TARGETS, then bind > yank-media--registered-handlers to the appropriate value when invoking > yank-media. Would that not defeat the point of yank-media, which is to present a simple, common interface to the clipboard data to major-mode authors? This approach also means that we would end up with org-yank-media, html-yank-media, etc. which does not sound better.