From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: yank-media: allow users to limit image types that can be inserted Date: Tue, 24 Sep 2024 14:30:01 +0300 Message-ID: <86tte5e1c6.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13212"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rpluim@gmail.com, visuweshm@gmail.com, emacs-devel@gnu.org To: pinmacs Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 24 13:31: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 1st3l9-0003CF-Nc for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Sep 2024 13:31:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st3k8-0005on-HL; Tue, 24 Sep 2024 07:30:08 -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 1st3k7-0005o6-Ch for emacs-devel@gnu.org; Tue, 24 Sep 2024 07:30:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st3k6-0005VW-NJ; Tue, 24 Sep 2024 07:30:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=QwkArTTjb/Yxftv4RM1/CYETGlYkwYJsD0PudyUyNkc=; b=sPVV2is8Zf8L Cfsxhu3fGS3hsl5N7dIbqTERZP1rOTQyWxNOSx446fH1ZTU4AG54kqbosO6BLT9R/x1CD6dYgUivg xv0/9IxrOKi0XB6YUDbt7MyQBschkUDzIVTgu/dKHgZyn3C2jwKr214x9U05PsdIAPEmgtcRWO/oR GhtMpZUzH2xmh/c31CEPjUv1m7zEsO9elDLgk5v3gztZw7x/XxRtWey7d6T1kLAHJGpE/sdGFNzVx Z9j/PCvxHe252n4yyBtpc8OiofKp/hJhw9aXYKXSGu0VYiITuuzDd1k5YzKATfE1fH/Bes1mzC0Xk gQ3FIJR9tGTWXfkvTdSmGQ==; In-Reply-To: (message from pinmacs on Mon, 23 Sep 2024 18:08:58 -0300) 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:324019 Archived-At: > Date: Mon, 23 Sep 2024 18:08:58 -0300 > Cc: rpluim@gmail.com, visuweshm@gmail.com, emacs-devel@gnu.org > From: pinmacs > > Eli, I think we can solve the three situations described with following > algorithm/idea/inspiration [1]: through a configurable variable > (yank-media-image-types ?). That would allow you to be able to select > among all options (that for certain cases could be interesting, say > "expert mode", I know what I am doing, verbose mode, etc.), and also, a > way to filter out certain candidates based on what you need. > > Making that variable equal to nil would be as it is now, and configuring > it to "image/png", would only select one. I think others were thinking > about a regex. As you wish, I only need some sort of filter, and I don't > care too much on the detail of how it is configured. First, I think a simple defcustom will not be enough, since changing the list of handlers must go through yank-media-handler. More importantly, I still don't understand the rationale and the use cases where this could be useful, and adding yet another user option without understanding its need and intended usage is not something I'd like us to do. Emacs already has way too many user options. Thanks.