From unknown Fri Jun 20 07:09:28 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#4176 <4176@debbugs.gnu.org> To: bug#4176 <4176@debbugs.gnu.org> Subject: Status: 23.1; partial completions Reply-To: bug#4176 <4176@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:09:28 +0000 retitle 4176 23.1; partial completions reassign 4176 emacs submitter 4176 Eli Barzilay severity 4176 normal thanks From eli@barzilay.org Mon Aug 17 07:30:20 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 17 Aug 2009 14:30:21 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.1 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7HEUI9e025577 for ; Mon, 17 Aug 2009 07:30:20 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Md3E2-0006vZ-FN for bug-gnu-emacs@gnu.org; Mon, 17 Aug 2009 10:30:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Md3Dx-0006rd-CK for bug-gnu-emacs@gnu.org; Mon, 17 Aug 2009 10:30:17 -0400 Received: from [199.232.76.173] (port=58470 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Md3Dx-0006rX-3G for bug-gnu-emacs@gnu.org; Mon, 17 Aug 2009 10:30:13 -0400 Received: from winooski.ccs.neu.edu ([129.10.115.117]:46754 helo=barzilay.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Md3Dw-00013z-LN for bug-gnu-emacs@gnu.org; Mon, 17 Aug 2009 10:30:12 -0400 Received: from eli by barzilay.org with local (Exim 4.66) (envelope-from ) id 1Md3Du-0000xA-W4 for bug-gnu-emacs@gnu.org; Mon, 17 Aug 2009 10:30:10 -0400 From: Eli Barzilay MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19081.26994.931953.186612@winooski.ccs.neu.edu> Date: Mon, 17 Aug 2009 10:30:10 -0400 To: bug-gnu-emacs@gnu.org Subject: 23.1; partial completions X-Mailer: VM 7.19 under Emacs 22.1.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) With the default settings, enter C-h f select-window TAB and Emacs will tell you that this is the only completion. Trying this with `sele-wind TAB' does a partial completion to `select-window' and moves the cursor to the right place -- a second TAB pops up the completions (showing both functions) saying "complete but not unique" *but* moves the cursor to the end. It would be very nice if the cursor was always at the right place, and it would not say that this is the only completion. Doing (setq completion-styles '(partial-completion)) is fixes the message, but the cursor still moves to the end. Another related problem -- the doc string for `completion-styles' doesn't say anything about what's allowed (should mention `completion-styles-alist'). Also, the functions that are used in `completion-styles-alist' are not documented -- which leaves the user with no explanation at all about the available completion styles. In GNU Emacs 23.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.14) of 2009-08-01 on winooski.ccs.neu.edu Windowing system distributor `The X.Org Foundation', version 11.0.10300000 configured using `configure '--prefix=/home/eli/bin/local/emacs-dir'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: POSIX value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: whitespace-mode: t cua-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t temp-buffer-resize-mode: t line-number-mode: t transient-mark-mode: t Recent input: l e c t - w i l C-g C-g C-g ; C-x C-e C-h f s e l e c - w i n C-g ; C-x C-e C-h f s e l e - w i n d C-g C-g C-h f s e l - w i n C-g C-g ; C-x C-e C-h f s e l e c t - w i n d o C-g C-g C-h f s e l - w i n C-g C-g M-x r e p o r t - w i n e e m a - b u From eli@barzilay.org Mon Aug 17 07:52:10 2009 Received: (at 4176) by emacsbugs.donarmstrong.com; 17 Aug 2009 14:52:11 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER, SPF_HELO_PASS autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from barzilay.org (winooski.ccs.neu.edu [129.10.115.117]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7HEq9wD029034 for <4176@emacsbugs.donarmstrong.com>; Mon, 17 Aug 2009 07:52:10 -0700 Received: from eli by barzilay.org with local (Exim 4.66) (envelope-from ) id 1Md3ZB-0001Cx-06 for 4176@emacsbugs.donarmstrong.com; Mon, 17 Aug 2009 10:52:09 -0400 From: Eli Barzilay MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19081.28312.991657.218640@winooski.ccs.neu.edu> Date: Mon, 17 Aug 2009 10:52:08 -0400 To: 4176@debbugs.gnu.org Subject: Re: bug#4176: Acknowledgement (23.1; partial completions) In-Reply-To: References: <19081.26994.931953.186612@winooski.ccs.neu.edu> X-Mailer: VM 7.19 under Emacs 22.1.1 After a quick look, I tried to redefine `minibuffer-complete' and just comment out the second (goto-char (field-end)). This seems to work wrt wrongly moving the cursor to the end which seems to resolve both problems when combined with (setq completion-styles '(partial-completion)) However, 1. Since this code was put there explicitly, there must be some issue I don't see in removing it. 2. Even after the quick code browse I have no idea what wonderful features I'm losing by removing `basic' and `emacs22' from `completion-styles'. I would be happy if someone can enlighten me. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From monnier@iro.umontreal.ca Mon Aug 17 12:57:28 2009 Received: (at 4176) by emacsbugs.donarmstrong.com; 17 Aug 2009 19:57:29 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.7 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7HJvRaU021244 for <4176@emacsbugs.donarmstrong.com>; Mon, 17 Aug 2009 12:57:28 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhAFALBSiUpFpZNo/2dsb2JhbACBUtQQhBkFgU2FfA X-IronPort-AV: E=Sophos;i="4.43,398,1246852800"; d="scan'208";a="43680033" Received: from 69-165-147-104.dsl.teksavvy.com (HELO pastel.home) ([69.165.147.104]) by ironport2-out.teksavvy.com with ESMTP; 17 Aug 2009 15:56:49 -0400 Received: by pastel.home (Postfix, from userid 20848) id 26F5C82F0; Mon, 17 Aug 2009 15:57:21 -0400 (EDT) From: Stefan Monnier To: Eli Barzilay Cc: 4176@debbugs.gnu.org Subject: Re: bug#4176: Acknowledgement (23.1; partial completions) Message-ID: References: <19081.26994.931953.186612@winooski.ccs.neu.edu> <19081.28312.991657.218640@winooski.ccs.neu.edu> Date: Mon, 17 Aug 2009 15:57:21 -0400 In-Reply-To: <19081.28312.991657.218640@winooski.ccs.neu.edu> (Eli Barzilay's message of "Mon, 17 Aug 2009 10:52:08 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > After a quick look, I tried to redefine `minibuffer-complete' and just > comment out the second (goto-char (field-end)). This seems to work > wrt wrongly moving the cursor to the end which seems to resolve both [...] > 1. Since this code was put there explicitly, there must be some issue > I don't see in removing it. I don't have time to dig into this right now, but the cursor placement is fairly tricky indeed, and there are often different valid choices depending on your particular preferences. The rule I tried to follow (in the partia-completion code) is that the cursor should be placed to the rightmost position that still offers ways to persue completion. In your `select-window' example, it seems that the behavior doesn't follow this rule, so it might indeed be a plain bug. > 2. Even after the quick code browse I have no idea what wonderful > features I'm losing by removing `basic' and `emacs22' from > `completion-styles'. I would be happy if someone can enlighten me. You lose the fact that the default Emacs-23 completion is a compromise between the non-partial-completion and the partial-completion behavior. If you used partial-completion and liked it, you probably want to do (setq completion-styles '(partial-completion)) like you did. But remember that enabling partial-completion by default in Emacs-23 didn't get accepted without a fight. Stefan From monnier@IRO.UMontreal.CA Tue Aug 18 12:11:59 2009 Received: (at 4176-done) by emacsbugs.donarmstrong.com; 18 Aug 2009 19:11:59 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.3 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7IJBv0U026363 for <4176-done@emacsbugs.donarmstrong.com>; Tue, 18 Aug 2009 12:11:58 -0700 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n7IJBsBX028458; Tue, 18 Aug 2009 15:11:54 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 6ECA53A0F6; Tue, 18 Aug 2009 15:11:54 -0400 (EDT) From: Stefan Monnier To: Eli Barzilay Subject: Re: bug#4176: 23.1; partial completions Message-ID: References: <19081.26994.931953.186612@winooski.ccs.neu.edu> Date: Tue, 18 Aug 2009 15:11:54 -0400 In-Reply-To: <19081.26994.931953.186612@winooski.ccs.neu.edu> (Eli Barzilay's message of "Mon, 17 Aug 2009 10:30:10 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3343=0 >>>>> "Eli" == Eli Barzilay writes: > With the default settings, enter > C-h f select-window TAB > and Emacs will tell you that this is the only completion. > Trying this with `sele-wind TAB' does a partial completion to > `select-window' and moves the cursor to the right place -- a > second TAB pops up the completions (showing both functions) saying > "complete but not unique" *but* moves the cursor to the end. Removing the second (goto-char (field-end)) in minibuffer-complete was indeed a correct solution, in the end. I've installed a sligtly different patch so that the point-motion is consolidated inside completion--do-completion. See below the patch I installed. > It would be very nice if the cursor was always at the right place, and > it would not say that this is the only completion. Doing > (setq completion-styles '(partial-completion)) > is fixes the message, but the cursor still moves to the end. The "sole completion" message is correct, given the default value of completion-styles. > Another related problem -- the doc string for `completion-styles' > doesn't say anything about what's allowed (should mention > `completion-styles-alist'). Thanks, it does mention it now. > Also, the functions that are used in `completion-styles-alist' are not > documented -- which leaves the user with no explanation at all about > the available completion styles. The functions are low-level, so the user shouldn't be expected to look at them and/or their docstrings to find out what the style does. The name of the style should hopefully be sufficient. Stefan --- minibuffer.el.~1.77.~ 2009-08-04 14:03:35.000000000 -0400 +++ minibuffer.el 2009-08-18 15:07:35.000000000 -0400 @@ -308,7 +308,8 @@ ALL-COMPLETIONS is the function that lists the completions.") (defcustom completion-styles '(basic partial-completion emacs22) - "List of completion styles to use." + "List of completion styles to use. +The available styles are listed in `completion-styles-alist'." :type `(repeat (choice ,@(mapcar (lambda (x) (list 'const (car x))) completion-styles-alist))) :group 'minibuffer @@ -388,7 +389,9 @@ (cond ((null comp) (ding) (minibuffer-message "No match") (minibuffer--bitset nil nil nil)) - ((eq t comp) (minibuffer--bitset nil nil t)) ;Exact and unique match. + ((eq t comp) + (goto-char (field-end)) + (minibuffer--bitset nil nil t)) ;Exact and unique match. (t ;; `completed' should be t if some completion was done, which doesn't ;; include simply changing the case of the entered string. However, @@ -462,11 +465,9 @@ (case (completion--do-completion) (#b000 nil) - (#b001 (goto-char (field-end)) - (minibuffer-message "Sole completion") + (#b001 (minibuffer-message "Sole completion") t) - (#b011 (goto-char (field-end)) - (minibuffer-message "Complete, but not unique") + (#b011 (minibuffer-message "Complete, but not unique") t) (t t))))) @@ -694,11 +695,9 @@ (interactive) (case (completion--do-completion 'completion--try-word-completion) (#b000 nil) - (#b001 (goto-char (field-end)) - (minibuffer-message "Sole completion") + (#b001 (minibuffer-message "Sole completion") t) - (#b011 (goto-char (field-end)) - (minibuffer-message "Complete, but not unique") + (#b011 (minibuffer-message "Complete, but not unique") t) (t t))) From unknown Fri Jun 20 07:09:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 18 Sep 2009 14:24:17 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator