From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#64656: 29.0.91; Doc of minibuffer histories and completing-read - automatic addition of completions to DEFAULT list Date: Mon, 06 Nov 2023 09:28:39 +0200 Organization: LINKOV.NET Message-ID: <867cmvcpco.fsf@mail.linkov.net> References: <83y1jga0nr.fsf@gnu.org> <83o7kb9a40.fsf@gnu.org> <86bkg84de3.fsf@mail.linkov.net> <86jzrhlrub.fsf_-_@mail.linkov.net> <867cmw83zb.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18096"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 64656@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 06 08:32:59 2023 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 1qzu6V-0004YF-S1 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Nov 2023 08:32:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qzu64-0001hR-5T; Mon, 06 Nov 2023 02:32:32 -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 1qzu5x-0001d6-8A for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 02:32:25 -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 1qzu5w-00089b-W4 for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 02:32:25 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qzu6Y-0007AG-5a for bug-gnu-emacs@gnu.org; Mon, 06 Nov 2023 02:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Nov 2023 07:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64656 X-GNU-PR-Package: emacs Original-Received: via spool by 64656-submit@debbugs.gnu.org id=B64656.169925598027526 (code B ref 64656); Mon, 06 Nov 2023 07:33:02 +0000 Original-Received: (at 64656) by debbugs.gnu.org; 6 Nov 2023 07:33:00 +0000 Original-Received: from localhost ([127.0.0.1]:38593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzu6W-00079t-G7 for submit@debbugs.gnu.org; Mon, 06 Nov 2023 02:33:00 -0500 Original-Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]:44213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzu6U-00079N-OD for 64656@debbugs.gnu.org; Mon, 06 Nov 2023 02:32:59 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id CA4E620008; Mon, 6 Nov 2023 07:32:14 +0000 (UTC) In-Reply-To: <867cmw83zb.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 05 Nov 2023 20:11:36 +0200") X-GND-Sasl: juri@linkov.net 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:273861 Archived-At: >>>> > `C-h v org TAB' >>>> > `M-n' >>>> > `M-n' > > I become convinced more and more that the problem lies somewhere else. > Trying to customize 'completions-sort' to the valid option 'nil' > ("No sorting") reveals there are some completions where a meaningful > order is still not maintained. For example, 'C-x v b l TAB' > displays branches in the order reverse from the output of > `git for-each-ref --format="%(refname)"`. Here is the fix: > > #+begin_src patch > diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el > index 9ec45c59893..7a3eaba78c7 100644 > --- a/lisp/vc/vc-git.el > +++ b/lisp/vc/vc-git.el > @@ -1723,7 +1729,7 @@ vc-git-revision-table > "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$"))) > (while (re-search-forward regexp nil t) > (push (match-string 2) table)))) > - table)) > + (nreverse table))) > > (defun vc-git-revision-completion-table (files) > (letrec ((table (lazy-completion-table > #+end_src Pushed. Customizing 'completions-sort' to the option 'nil' ("No sorting") reveals more interesting things. For example, when vc completes a backend, it turns out that the order is manually crafted: (defcustom vc-handled-backends '(RCS CVS SVN SCCS SRC Bzr Git Hg) ;; RCS, CVS, SVN, SCCS, and SRC come first because they are per-dir ;; rather than per-tree. RCS comes first because of the multibackend ;; support intended to use RCS for local commits (with a remote CVS server).