From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62700: 29.0.60; minibuffer-{previous,next,choose}-completion behave unintuitively when point is not at end of buffer Date: Thu, 06 Apr 2023 16:42:13 -0400 Message-ID: References: <83r0swq39p.fsf@gnu.org> <83jzyoq040.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33956"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62700@debbugs.gnu.org, Spencer Baugh , juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 06 22:43:37 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 1pkWSG-0008b7-VN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Apr 2023 22:43:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pkWRl-0004iB-4q; Thu, 06 Apr 2023 16:43:05 -0400 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 1pkWRj-0004hp-LM for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 16:43:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pkWRj-0000cL-1B for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 16:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pkWRi-0006Rx-Gb for bug-gnu-emacs@gnu.org; Thu, 06 Apr 2023 16:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Apr 2023 20:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62700 X-GNU-PR-Package: emacs Original-Received: via spool by 62700-submit@debbugs.gnu.org id=B62700.168081374824745 (code B ref 62700); Thu, 06 Apr 2023 20:43:02 +0000 Original-Received: (at 62700) by debbugs.gnu.org; 6 Apr 2023 20:42:28 +0000 Original-Received: from localhost ([127.0.0.1]:55287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkWRA-0006R3-6a for submit@debbugs.gnu.org; Thu, 06 Apr 2023 16:42:28 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:37401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pkWR5-0006Qm-T0 for 62700@debbugs.gnu.org; Thu, 06 Apr 2023 16:42:26 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 316341000DC; Thu, 6 Apr 2023 16:42:18 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id A84641000BE; Thu, 6 Apr 2023 16:42:16 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1680813736; bh=kkqZCWRN5Q8GEmIWf/ouBsuP5ufDvytHi4VKboZ5fP0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pnvsJ38dnyKwwhHJRA4Xzie7dmuLLJtiuf/0XfUupFHyazoE0ZMWoG35rPIosW+/K 8NuPbuj5lfS6FqvWArQIj/x2p1DxdDgZuUOnsgMx936q+/PelhzRbkG3lf6gBH3B88 t5SY0mjvmzgnF8mbITvgGbK9/xNC/ysxDl7sKohrdN/ookDP3VwfeWbmSl5qpvc7Ue 6n5zM13NCeGVXAeTVCYwqinNmD4L7fKh52qQCqWf0BOtHe/s6yGPxieo6ycVVgB5ce WfVj0fY+YDdUj5JcUdW6oDSpOAarq+EMtFbfd1KMEfWIwAOnFn6wq7nu+NnttdviXq Be/3/TcPuJnfQ== Original-Received: from alfajor (unknown [45.44.229.252]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 74FAD1233A5; Thu, 6 Apr 2023 16:42:16 -0400 (EDT) In-Reply-To: <83jzyoq040.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 06 Apr 2023 22:30:55 +0300") 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:259356 Archived-At: >> > I think it's the intended behavior. In this case, it looks not >> > useful, because the string you typed before starting to use M- and >> > M- happens to be at the end of each completion candidate. But >> > this is not the only situation possible. Basically, completion always >> > modifies only the text before point, leaving what's after point >> > intact, so that the user could have after point stuff that completion >> > should ignore, and that eventually will be appended to the selected >> > candidate. >> >> Could you give an example of when this would be desirable? > > When completing on shell commands, for example: the text after point > is usually the command-line arguments to the command, and the > completion is on command names or on some file name. That shouldn't be a worry: when you complete shell commands, you're not really using "minibuffer completion" (as is the case in `C-h v`) but "in-buffer completion" (i.e. TAB is bound to `completion-at-point` rather than to `minibuffer-complete`), so the completion code knows that you're only completing the command part and will (hopefully) be careful not to touch anything before or after it. More specifically, in `M-!` if you're at echo hello; e!s world where `!` shows where point is, the *Completions* buffer should show all command that start with `e` and end in `s` (assuming we're using `basic` or `partial-completion` styles) and if you use minibuffer-{previous,next,choose}-completion, they should replace `e!s` with the selection. IOW it should neither "leave the text after point alone" nor "replace all the text after point". >> For example, suppose I wanted to wanted to complete filenames starting >> with x and ending in .c. > I don't think the default completion supports such functionality, at > least not with the styles we have by default in completion-styles. The behavior Spencer describes is very much part of our default (it's provided both by the `basic` and the `partial-completion` styles, both of which are enabled by default). Stefan