From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Completions and history Date: Tue, 12 Apr 2022 19:35:35 +0200 Message-ID: <20220412173535.pa23mtie2dmeeoco@Ergus> References: <20220411112901.kv3lsyvx6yxwjbph.ref@Ergus> <20220411112901.kv3lsyvx6yxwjbph@Ergus> <86sfqjzhgl.fsf@mail.linkov.net> <20220411174031.2yuh2je5fl3lej7i@Ergus> <86v8vetgst.fsf@mail.linkov.net> <20220412165958.2jzxtqxvx7jxmndy@Ergus> <86h76ytee5.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28997"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 12 19:36:49 2022 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 1neKRd-0007RF-6h for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Apr 2022 19:36:49 +0200 Original-Received: from localhost ([::1]:46400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1neKRa-0002sc-28 for ged-emacs-devel@m.gmane-mx.org; Tue, 12 Apr 2022 13:36:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1neKQf-0001vM-Td for emacs-devel@gnu.org; Tue, 12 Apr 2022 13:35:50 -0400 Original-Received: from sonic315-13.consmr.mail.bf2.yahoo.com ([74.6.134.123]:44931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1neKQe-0000vx-3u for emacs-devel@gnu.org; Tue, 12 Apr 2022 13:35:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1649784945; bh=dV4Cx772gy50KzA0s2+S19JQ7J0FGf/UUxixFB1xfFM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=F01qkCwaBJ0t54F8IQmcLWTwQC6tQWlKzwaRmNPwUdpdlDE+MHIWw29Ev9HhAM+aVvG8SQ19h+FMllSfgEr0hgRcR+X8Q5NRAYRHCV+mq9n25ZhMFJY7oASP1Q4OAocqnfTiREAv4Mn4fulYUgj403Qxc6d9KAF+7gAuSN0r+w5nNl9tf/ZRkUF5W8a0Y2LWGh9ofaTEzAhKyE1uzTVcASKzlGDNQYvZZhggiG7/XpcPTHfhfA68XxO2d+ty8kKAkXa51oixLC+0lTDgujM3qhME86BfXAhUdMvpIoGULsXUpMX4gTI7Sy4E6B/nXJT9LQbZwVBozaEJNGcKZDE5Tg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1649784945; bh=cnDaoHqJAyGUhM4idS79P3qRHqnFncc1408AlMrSq4f=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=PKslB09ZXPQUIxLus+q2tFSMRTCIgAdBC7Xl1rcoeA+keGpe/18BRt5Omiyt3Kc4cevSekjoFkT3kFkiPVHSIe7zHoyClESeaQB/F9XDVLPdVCDiMSlfrDvbytH3l/cNHTojGBgbHcsFZu8MwZxx8//ZqPuFD8Q4+2PENU+PBS/+ynppqGrFd3ZtyHGlW9seQMPa7zJtJxdowd0d+shAvu1lyL/RGlVepeYozCZ3ZdVJ4Wt8UE/NgHIFN6qt8YGryBnTHA2UqYGoDUuxHao6dVstFLUCIcuTjXTGMHzc2FDDpPeBT51ONV4pG/yLTJmBseD5C9N5p5+yak6UwlMnGQ== X-YMail-OSG: i8CtQLsVM1l8CISB6DDBbG.WH2te83A3FbDc6tKMK_fdfmFVQun_1qxy_uy9FaJ JhisorfBdvyDG.E9S.gEyyn03qMZj8pdFH_fnYYCwpfVWL2JhAHeIhnf45lN_Xx7iZRWqCJwIMbg MwV8X5qgW6ZagHUvy.0MNb8f4oVmxmdPeMzyN.UKjx_KA5pPSF8D1FqOMsNi8t.1RGCd3yUQm0lt a5Ux9mcV3IgW4iGfua5Sw3qh9SOiEs73b2YeaY2PlOeVgr6dbcubySf2eKXZbSfNj6IiMNsQEvYE 8pKWK1nnbETf1g21sNr1RyDqzD3x0cnDCkxh9JEapLjfZ7AX_sX1fybKb8z_apxUHKVl2CPGfVkP CHOtYjnJ.rbAh1R6E6jaKO38x.PvQTCskxqlokc7SY1bfFnIbXypDuU0xk07MWRuLskLheIv_OYc zYTDsPrpjBn4VM_KMbJwliOzOug2hLJcbRNYpFWHRQQnqiBp3Ne_xKmO1M3HOF2BZhcPj53B9eCj wVfHy5XsCVRmp61dow6OF9x8MDDdZ0L5tOqTtFz2QCNgKsllejsUFBqQL5ImHa1QCFdOKt3UH7PV _lmZv9a6XBlb6T_3L4aIxK2gHkMr0Xq4uBNnB32g124JYRN8VWVsNdiEFhpAIZiKDs625ew2nYgV SVsvG6PjLxnRWeQ3DToU8tmC1j0Oad.EovzgGtTf7MZpXdMdve9d164zaJ5im.x4jgrqkvhfNXV2 64Lp91A35JWU8Z_VAtAnmOyMSFEqi1bzIYy9no1zuTqJKxuDvNPefj9V.1H4zbJL7l7ilc2xSnvp .nmtpMzDNdCxNizw0WaHzsjCrGAnuj62nkZLOerAMI X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Tue, 12 Apr 2022 17:35:45 +0000 Original-Received: by kubenode505.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID c12bb5742b5d2bf3130ec2141b559607; Tue, 12 Apr 2022 17:35:40 +0000 (UTC) Content-Disposition: inline In-Reply-To: <86h76ytee5.fsf@mail.linkov.net> X-Mailer: WebService/1.1.20001 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.134.123; envelope-from=spacibba@aol.com; helo=sonic315-13.consmr.mail.bf2.yahoo.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, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:288324 Archived-At: On Tue, Apr 12, 2022 at 08:12:02PM +0300, Juri Linkov wrote: >>> One problem is that completions are sorted alphabetically that >>> makes no sense for history items which are sorted chronologically. >>> So the first thing to do would be to add sorting keys in Completions >>> that will allow switching the order between alphabetical and unsorted >>> (history items are in chronological order, so unsorted should keep it) >>> that will change the value of 'completions-sort'. >> >> A comment about this... completion-at-point-functions accept a list with >> a format (START END COLLECTION . PROPS) >> >> The PROPS can be any :completion-extra-properties plus predicate and >> exclusive.. maybe the way to do this is to add a property :sort or >> similar... Then on the other side we use that property to select the >> sorting method... Does it makes sense? > >It already works fine with: > >``` >(defun minibuffer-complete-history () > "Complete the minibuffer history as far as possible. >Like `minibuffer-complete' but completes on the history items >instead of the default completion table." > (interactive) > (let ((completions-sort nil)) > (completion-in-region (minibuffer--completion-prompt-end) (point-max) > (symbol-value minibuffer-history-variable) > nil))) > >(define-key minibuffer-local-map [C-tab] 'minibuffer-complete-history) >``` > >So the only question is whether this should have a new defcustom? >Maybe 'minibuffer-complete-history-sort'? > >>> Another question: should duplicate history items be retained >>> in the Completions window when history-delete-duplicates is nil? >> >> In principle yes... unless you add another custom for that... But the >> first is the important part.. to have the history list in order... > >Another defcustom? Maybe 'minibuffer-complete-history-delete-duplicates'? Hi Juri, somehow this does not work for me completely fine (at least not as I was expecting)... I mean, then we TAB the completion is updated but with normal, not history completions... I would expect that C-tab (or any key) somehow toggle the completions to a history list... so when using history to complete they persist until I toggle them back to normal completion.... Is that too much to request?? If so, then I will try to be used to this one, but somehow I feel it a bit confusing.