From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#62836: [PATCH] Provide an example of using fuzzier completion. Date: Tue, 18 Apr 2023 18:07:26 -0400 Message-ID: References: <83a5z9ee6m.fsf@gnu.org> <87y1mslran.fsf@catern.com> <83sfd0bc8c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33763"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62836@debbugs.gnu.org, sbaugh@catern.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 19 00:08:28 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 1potUx-0008a1-UU for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Apr 2023 00:08:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1potUc-0000b3-4d; Tue, 18 Apr 2023 18:08:06 -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 1potUZ-0000ao-9z for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2023 18:08:04 -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 1potUY-0007xY-UI for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2023 18:08:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1potUY-0001IT-68 for bug-gnu-emacs@gnu.org; Tue, 18 Apr 2023 18:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Apr 2023 22:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62836 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 62836-submit@debbugs.gnu.org id=B62836.16818556564952 (code B ref 62836); Tue, 18 Apr 2023 22:08:02 +0000 Original-Received: (at 62836) by debbugs.gnu.org; 18 Apr 2023 22:07:36 +0000 Original-Received: from localhost ([127.0.0.1]:60611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1potU7-0001Ho-QM for submit@debbugs.gnu.org; Tue, 18 Apr 2023 18:07:36 -0400 Original-Received: from mxout6.mail.janestreet.com ([64.215.233.21]:39581) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1potU4-0001HY-Vk for 62836@debbugs.gnu.org; Tue, 18 Apr 2023 18:07:34 -0400 In-Reply-To: <83sfd0bc8c.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 16 Apr 2023 08:57:39 +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:260245 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: sbaugh@catern.com >> Date: Sat, 15 Apr 2023 22:22:09 +0000 (UTC) >> Cc: Spencer Baugh , 62836@debbugs.gnu.org >> >> Eli Zaretskii writes: >> >> > Finally, please use @kbd{@key{TAB}} in the context that calls for the >> > user to press the TAB key. >> >> Hm, the text already present in the "Completion Example" section doesn't >> use @kbd{@key{TAB}}, should it be doing that? > > Those are mistakes--these 2 paragraphs: > > If you type @key{TAB} again immediately, it cannot determine the > next character; it could be @samp{-}, @samp{a}, or @samp{c}. So it > does not add any characters; instead, @key{TAB} displays a list of all > possible completions in another window. > > Next, type @kbd{-f}. The minibuffer now contains @samp{auto-f}, and > the only command name that starts with this is @code{auto-fill-mode}. > If you now type @key{TAB}, completion fills in the rest of the > argument @samp{auto-fill-mode} into the minibuffer. > > should use @kbd{@key{TAB}} where they say "when you type". Feel free > to fix those blunders as part of the patch. > >> Here's the revised version incorporating all of these: >> >> @key{TAB} also works while point is not at the end of the >> minibuffer. In that case, it will fill in text both at point and at >> the end of the minibuffer. If you type @kbd{M-x autocm}, then press >> @kbd{C-b} to move point before the @samp{m}, you can type >> @kbd{@key{TAB}} to insert the text @samp{onf-} at point and @samp{ode} >> at the end of the minibuffer, so that the minibuffer contains >> @samp{autoconf-mode}. > > LGTM, thanks. Cool, here's the patch then: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Give-an-example-of-completion-with-point-not-at-end-.patch >From 592541aaec70400e69f27d9f2f2a6972f203e30f Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Tue, 18 Apr 2023 18:03:36 -0400 Subject: [PATCH] Give an example of completion with point not at end of minibuffer This can be a useful substitute for full-on fuzzy completion, as provided by other completion styles and completion packages. * doc/emacs/mini.texi (Completion Example): Give an example of completion with point not at end of minibuffer. Also, use @kbd{@key{TAB}} when telling the user to hit TAB. --- doc/emacs/mini.texi | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index 812218d1ab2..c75d68b4f69 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi @@ -313,14 +313,14 @@ Completion Example called @code{authorize-me} was defined, Emacs could only complete as far as @samp{aut}.) - If you type @key{TAB} again immediately, it cannot determine the -next character; it could be @samp{-}, @samp{a}, or @samp{c}. So it -does not add any characters; instead, @key{TAB} displays a list of all -possible completions in another window. + If you type @kbd{@key{TAB}} again immediately, it cannot determine +the next character; it could be @samp{-}, @samp{a}, or @samp{c}. So +it does not add any characters; instead, @key{TAB} displays a list of +all possible completions in another window. Next, type @kbd{-f}. The minibuffer now contains @samp{auto-f}, and the only command name that starts with this is @code{auto-fill-mode}. -If you now type @key{TAB}, completion fills in the rest of the +If you now type @kbd{@key{TAB}}, completion fills in the rest of the argument @samp{auto-fill-mode} into the minibuffer. Hence, typing just @kbd{a u @key{TAB} - f @key{TAB}} allows you to @@ -340,6 +340,14 @@ Completion Example the end of the minibuffer, so that the minibuffer contains @code{autoconf-mode}. + @key{TAB} also works while point is not at the end of the +minibuffer. In that case, it will fill in text both at point and at +the end of the minibuffer. If you type @kbd{M-x autocm}, then press +@kbd{C-b} to move point before the @samp{m}, you can type +@kbd{@key{TAB}} to insert the text @samp{onf-} at point and @samp{ode} +at the end of the minibuffer, so that the minibuffer contains +@samp{autoconf-mode}. + @node Completion Commands @subsection Completion Commands -- 2.30.2 --=-=-=--