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.bugs Subject: bug#75116: [PATCH] Make 'yank-media' autoselect the best media type Date: Mon, 06 Jan 2025 21:15:31 +0200 Message-ID: <867c7769f0.fsf@gnu.org> References: <87o70yeiih.fsf@gmail.com> <86r05uxx4i.fsf@gnu.org> <871pxtcxiq.fsf@gmail.com> <86r05sro63.fsf@gnu.org> <87bjwkbls7.fsf@gmail.com> <87cygzhjw9.fsf@localhost> <868qrn6alg.fsf@gnu.org> <8734hvhifj.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5441"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pinmacs@cas.cat, rpluim@gmail.com, 75116@debbugs.gnu.org, visuweshm@gmail.com To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 06 20:16:26 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tUsaN-0001EE-Kv for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jan 2025 20:16:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUsa9-0004wC-2x; Mon, 06 Jan 2025 14:16:09 -0500 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 1tUsa3-0004vw-Om for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 14:16:06 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUsa3-0007Nx-GM for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 14:16:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=0wmgBumCXiMfpfycK59wnwp/+m3OLLPVg5avya9F0jE=; b=RAZpV4eMPgEnzPDQDmumx+oETjQIECzRPNiKBS3gzyaPKRaMjuv9viaCn9jFIqsI9n4drq7WXkYURFw4RNP3sFD0pB3esHwywNgCjjjL9O3b352UE3Zr5uvRsdV8zFl7suo3L7kbyiOeA8UzVEbcnKA3gI7D6ZjL87az5DA+yhE9gmK0QKtc/3ijMQRFA5AOkwE27XSSeASMwI1KiKZlCL+yv+N7XFTsVJVQV13xhbZEJw3AqLEQrsUk3Sg8d1grT6/W/huWmgoyd6EhPHPCBVRbtGcvvMyA8UKcVyxdUYkJbqY70AtlIVQU3Zu9B3ptd81u48nlnRixB04yRHMO8w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUsa2-0005f1-C5 for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 14:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jan 2025 19:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75116 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 75116-submit@debbugs.gnu.org id=B75116.173619094621727 (code B ref 75116); Mon, 06 Jan 2025 19:16:02 +0000 Original-Received: (at 75116) by debbugs.gnu.org; 6 Jan 2025 19:15:46 +0000 Original-Received: from localhost ([127.0.0.1]:40112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUsZm-0005eN-0H for submit@debbugs.gnu.org; Mon, 06 Jan 2025 14:15:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40318) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUsZj-0005e5-LQ for 75116@debbugs.gnu.org; Mon, 06 Jan 2025 14:15:44 -0500 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 1tUsZc-0007HC-Bn; Mon, 06 Jan 2025 14:15:36 -0500 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=0wmgBumCXiMfpfycK59wnwp/+m3OLLPVg5avya9F0jE=; b=DiHJfIg9o4Jy aPPDdNslkpjMeqjWxW9W8UzGCAk6fipBRB75HtaCvGvgTBXI/wkn95lgus+RyCewkbANJxifMWjge YGAFaCterG0WTe4BzOvF37rhdIRVe0eULmWROj8f8W9F0jzoYI4UdfIVOazITO82sB/qckNYJVUSl 3aD20dCiyYG7dO1WWUnJES6uNCLjMEONpQgXHkgW4w07qsTsRCjTWUkTSPOKucX7jQuJQuT1sXIde oHaY5Q18t6aH1wLCZVtZ45F7ekf3DDQiocDXaTfgUZmSO33Q7PFI50p7HlHBQ2tyOYa2Rm9WXMfpj 5eZPbfcsUmsHR8zgGB85cQ==; In-Reply-To: <8734hvhifj.fsf@localhost> (message from Ihor Radchenko on Mon, 06 Jan 2025 19:05:20 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298689 Archived-At: > From: Ihor Radchenko > Cc: visuweshm@gmail.com, 75116@debbugs.gnu.org, pinmacs@cas.cat, > rpluim@gmail.com > Date: Mon, 06 Jan 2025 19:05:20 +0000 > > Eli Zaretskii writes: > > >> >>> User asks to autoselect: > >> >>> 1. autoselect-function (a-s-f) returns one media type: we yank it. > >> >> > >> >> Yes. > >> >> > >> >>> 2. a-s-f returns multiple media types: we ask the user which one > >> >>> to yank. > >> >> > >> >> No, we use the first one. > > ... > > That's what I mean by "ask": use the default behavior of the command. > > > > Conceptually, it's the same as the paste operation in other > > applications: by default, the application decides which of the formats > > to use, and if the user wants to choose, he/she needs to pop up a menu > > of available formats in some way and select from there. > > I see the logic. > > I still find returning a list of mimetypes useful though - if user wants > to implement an additional filter on top of a-s-f provided by major > mode, having a list of mimetypes as input is more flexible. We could leave the selection to the command level, and have the function return a list in all the cases. > But we need to document that the final choice will be taken as the first > element from what a-s-f (possibly adviced) returns. Under the default behavior of auto-selecting one type, yes. The function should therefore arrange for the first type to be the most reasonable/useful one.