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: Mon, 23 Sep 2024 14:20:39 +0300 Message-ID: <86ed5ahb08.fsf@gnu.org> References: <79fc91f3-c2c3-44db-9817-595808917f26@cas.cat> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24314"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: pinmacs Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 23 13:21:53 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 1ssh8b-00067l-0w for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Sep 2024 13:21:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssh7V-0005Hl-TZ; Mon, 23 Sep 2024 07:20:45 -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 1ssh7T-00059z-8x for emacs-devel@gnu.org; Mon, 23 Sep 2024 07:20:43 -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 1ssh7S-0003w8-Er; Mon, 23 Sep 2024 07:20:42 -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=gGfnL02RSPZOhtkHbWYraNI1HtXtrZv6/XoanrLGhvg=; b=TU9DVenKAIVf h7eZrxOgJTMmvjrJOHv9EPYYcVM57UDzk2wKLcjQ5OlN5s1OBSHnQ5C+2rvZlQt769KcMshBjIUWc ayz5dB6WSxf7y2UTiyM3nzepMXD12ORFtBFsZLsVdM0vmV8mZMDrEDWWDyWk0jB03NLHRSpTEQdhU GZ0PgvITGsjUIY+lXQO8BbFLoqhQ5e7QYqb7D53YJqyOYGx7I0TCA58MtYSUhkvPUUOR9KSi4W96G f13fyDkSY7/ujboLn+owFHn+TK2YZ8lG78v+t3/8dR3Czc2dztbfLCGU1GvA9SSeqbLMNjeotF2zm A2FC6Nr3gZiOT4+iHh2unA==; In-Reply-To: <79fc91f3-c2c3-44db-9817-595808917f26@cas.cat> (message from pinmacs on Sun, 22 Sep 2024 13:53:06 -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:323953 Archived-At: > Date: Sun, 22 Sep 2024 13:53:06 -0300 > From: pinmacs > > I submitted the following Feature Request in the orgmode list [1]. They > said that the second part related to "limitting image types that can be > inserted" should be done in the core emacs side. > > In that same thread [1], Ihor proposed different ways to implement it > [2], I also took how it explained the feature as part of this email-subject. > > The thing is that with orgmode we can easily attach images to buffer > thanks to `yank-media' feature, but there is a dialogue we cannot skip > and that is: selecting image types. Find attached an image file > "selecting-image-types.png", where you can see the 7 candidates for a > screenshot I did to serve as an example. > > 1. In case I want to be fast, I would like to skip that dialog entirely > and just use the image/png variant. > 2. In another perspective, I would consider that the relevant decision > for a screenshot would be between two of them: image/png and image/jpeg > 3. Another user could argue why the other 5 types are interesting in > general or for their particular use case... > > ... but let's stop that discussion here. Looks like filtering image > types would be a useful customization for the users. If done as a > variable, in certain cases, that could be local binded and specific to > some fast function that immediately inserts an image, and in another > case, the global var would select only those image types relevant for > that particular user. > > That is also positive if users want to add even more image types, with a > good and reasonable default, users will not worry about too many options > at some point. 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. Thanks.