From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Clemens Newsgroups: gmane.emacs.devel Subject: Re: Sorting command completions by recency Date: Wed, 17 Feb 2021 21:03:57 +0100 Message-ID: <9720b886-39aa-9a52-8c74-144fc7600175@posteo.de> References: <875z2qslwk.fsf@mail.linkov.net> <877dn635oe.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1537"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: Juri Linkov , emacs-devel@gnu.org To: Stefan Monnier , Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 17 21:08:27 2021 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 1lCT7Y-0000Bg-6n for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 21:08:24 +0100 Original-Received: from localhost ([::1]:49400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCT7X-0003yh-5l for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Feb 2021 15:08:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCT3W-0000k9-AJ for emacs-devel@gnu.org; Wed, 17 Feb 2021 15:04:14 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:44067) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCT3M-00026X-FU for emacs-devel@gnu.org; Wed, 17 Feb 2021 15:04:13 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 7A275240100 for ; Wed, 17 Feb 2021 21:03:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1613592239; bh=YqLcjyHUiNYns8PStq6AGTE8TeHsELMt2d1VNpRppK0=; h=Subject:To:Cc:From:Date:From; b=B/8Y6PsJqquyQ81dG0+ZQCQjSBbW2wOV2yyeFzjntr5kHbw4o5ZoEAMbwN4oP+ZTJ LZCu55USQ3vByL8iPJsBuyONZmCBBH+sJj22hszWOhjWI/uRr39WZOHC+nBwVdVSIT EVxm6x7Oxr3B263ww62XfEDWmT/rEI0f4HWeaBTOx9qx8Wou/SumuRNho4q+I10N4Y e+BMgsNDHmO0ONn9+ex1mbhscYGiT8Yi0EUVqrHmU16A+XmoKCSFN/498n637i3tGc yaGy2LDLn1vqUetfbkGS6NCKNGMh01Sh/v2bXCEE9iAdCTznGh5t1snsPGmLpKscSg K60LN31X9cgSg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Dgpgx5MvWz9rxl; Wed, 17 Feb 2021 21:03:57 +0100 (CET) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=185.67.36.66; envelope-from=clemens.radermacher@posteo.de; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 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" Xref: news.gmane.io gmane.emacs.devel:265069 Archived-At: >>> This code puts the recent commands at the top as well, >>> but probably it needs to be opt-in: >> Makes sense to me, and, yes. > > FWIW, the minibuffer.el code already uses this kind of sorting for the > list of completions used in things like `icomplete` and > `completion-cycle-threshold`. > > For *Completions* the sort was kept alphabetical so far because that's > also useful (for example in the case of M-x completion, it makes it > easier to skip over blocs of commands sharing the same prefix). > > So, while I think it can be useful to sort by some kind of "guessed > usefulness" such as presence in the history, I don't think this should > be forced by the completion table of commands. Maybe it would make sense to have a general option to configure this history sorting. When the table doesn't specify its own sorting one could opt in to always sort base on history.