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: Thu, 31 Oct 2024 14:18:43 +0530 Message-ID: <87r07wy7x0.fsf@gmail.com> References: <79fc91f3-c2c3-44db-9817-595808917f26@cas.cat> <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> <87wmht3n17.fsf@gmail.com> <86v7xdamck.fsf@gnu.org> <87sesh37ya.fsf@gmail.com> <86iktd8o9h.fsf@gnu.org> <87iktb171d.fsf@gmail.com> <830de500-7c21-4dad-8290-9ab0f210af97@cas.cat> 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="34430"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Pedro Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 31 09:49:12 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 1t6Qrg-0008sR-Mr for ged-emacs-devel@m.gmane-mx.org; Thu, 31 Oct 2024 09:49:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6QrM-0007jS-Tb; Thu, 31 Oct 2024 04:48:52 -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 1t6QrK-0007iw-L4 for emacs-devel@gnu.org; Thu, 31 Oct 2024 04:48:50 -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 1t6QrJ-00029Y-4p for emacs-devel@gnu.org; Thu, 31 Oct 2024 04:48:50 -0400 Original-Received: by mail-pl1-x642.google.com with SMTP id d9443c01a7336-207115e3056so6276435ad.2 for ; Thu, 31 Oct 2024 01:48:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730364528; x=1730969328; 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=zpNme8wYN+zXaagOB91qlIa3/wFfV9v2b5xgG4ZLABA=; b=Fja5w6coytzXFol5VG1eDQG4WebAYjxqwrQs4dIpDTa5kL9SX3M27NT0GXhoEANExE ZIhlxX5szB9goUB60TAykPtGyiIgonhWtX63j7uALgboxKnds8rJRQ8KoX/3cORDZ2Rm 3GgjCNagdZB2RCv7SxwcBGVp8TJ5bHRC6zuZ/RZMAxnaFcYfW0GA8oUM3Zjnjq7qbJGr ac7rolKTJ9ZBIq7BtKWiWeylheTxkliSXlnh+aKc1rCGVbFWRTCuNZoG2v9gPyI/m6aS TfUM49fhLzwYlC0jCS9lFTEGs6z6EgQqzbh0/dn6Qvz+QVS/I+XynrnTxyTUI644739d OLXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730364528; x=1730969328; 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=zpNme8wYN+zXaagOB91qlIa3/wFfV9v2b5xgG4ZLABA=; b=cXf1b/lnh6uQJOl1yKhQRJxmtpJVhZlcOw9NdPbpK2+7iWEkKaTTVp1spxvnL8eHGn lCtiU1akS6la/tobP2qGypCWhxl0gVAM5GZq3s4HwiVEmABxPHnTPoYJ4ie/GffGehML 0eqglZPKt8Au9iB/dD98KyHfnz1x6FeELWTJZkWcr8WuTijfgfdPUTIVkwFwemsjPdRQ vf9U6JP/KfI4/LXM5Eatr4mLh//1Bz+MRlmo/kXlULABuNv1bD0WkQ4wAUosWaiajyj0 c5vqgUuTq7DjjX9cjy+QPMiqIDeFGmfYy8+GRtH7S6bd6aPHr/vY3JOaT+X/qaACN6UI XZnQ== X-Gm-Message-State: AOJu0Yy8m0GoQa6KGU3hkono3QNxC3q0s6BrnZBa+Ee39aHkzWPTgYAn PoYoEG5aX2PuhRwSBAUN1gnB4IiB7O/N/ZyUOOtF6E8Uk1w2Icfl X-Google-Smtp-Source: AGHT+IFItNwebVpABCBpeE6aAGMWsAdXan/rE2/UvfjevaYXTqMmCoMESefF03yl2WQefiJN9tpt5A== X-Received: by 2002:a17:902:f684:b0:20c:bffe:e1e5 with SMTP id d9443c01a7336-210c6892b57mr244995005ad.19.1730364527577; Thu, 31 Oct 2024 01:48:47 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-211056ee3b3sm6130245ad.13.2024.10.31.01.48.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 01:48:47 -0700 (PDT) In-Reply-To: <830de500-7c21-4dad-8290-9ab0f210af97@cas.cat> (pedro@cas.cat's message of "Thu, 31 Oct 2024 00:22:57 +0100") 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: -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:324960 Archived-At: [=E0=AE=B5=E0=AE=BF=E0=AE=AF=E0=AE=BE=E0=AE=B4=E0=AE=A9=E0=AF=8D =E0=AE=85= =E0=AE=95=E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 31, 2024] P= edro wrote: > Hi Visuwesh, > > Thanks for the patch!! It is very useful to me. > > I tested it and it works as I originally expected: reduce the > interaction to minimum: I don't need to press enter anymore! :) > > I also tested it with two types [1]: jpeg and png; and then you see a > selector with just the two types you care instead of the 7 types that > flameshot screen capture tool offers. Thanks for the feedback. > > [1] > =C2=A0 (setq-local > =C2=A0=C2=A0=C2=A0 yank-media-preferred-type-function > =C2=A0=C2=A0=C2=A0 (lambda (types) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (if (or > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (memq 'image= /png types) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (memq 'image= /jpeg types)) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (list 'image/png '= image/jpeg) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 types))) > With this definition, you will be asked to choose between image/png and image/jpeg even when the clipboard contains only image/png (or image/jpeg).