unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ergus <spacibba@aol.com>
To: Juri Linkov <juri@linkov.net>
Cc: Philip Kaludercic <philipk@posteo.net>, emacs-devel@gnu.org
Subject: Re: [PATCH] Re: Other details about completion.
Date: Wed, 6 Apr 2022 19:45:32 +0200	[thread overview]
Message-ID: <20220406174532.chsgqkzd2gphyuh3@Ergus> (raw)
In-Reply-To: <86sfqqduon.fsf@mail.linkov.net>

On Wed, Apr 06, 2022 at 07:48:40PM +0300, Juri Linkov wrote:
>>>> 1) I think it is more intuitive to invert and use the M-S-<arrow>
>>>> minibuffer-choose-** and M-<arrow> for
>>>> minibuffer-{previous|next}-completion for not insert commands...
>>>
>>> Easier to type M-<arrow> were intended as the primary way to use this feature.
>> I know, but such primary behavior is too intrusive IMO.
>>
>>> Whereas more hard to type M-S-<arrow>/M-RET as a rarely used alternative.
>> Mi proposal (the suffix one) is basically to avoid the need of M-RET.
>
>So your proposal is something in between.  Then maybe instead of two sets
>of commands (that either insert the current completion or not) we could have
>one set of commands bound to M-<up>/M-<down>, and a customizable option with
>three values: insert, don't insert, use transient suffix.
>
I would prefer something simpler even if we need to sacrifice some
functionality or customization...

>> I took the idea basically from some configs around for fish and zsh..
>> ...
>> But OTOH I will strongly recommend the C-g and arrow navigation
>> behavior... That could be maybe implemented with a set-transient-map...
>
>What is also interesting to note is that even every web browser
>uses own completion logic:
>
>1. in Firefox: the suffix of the first completion is inserted to the
>   address bar as the selected region, but <up>/<down> inserts
>   the completion without selecting its suffix, like M-<up>/M-<down>
>   currently does in Emacs.  One ESC closes the completions window,
>   another ESC clears the address bar.
>
>2. in Chromium: <up>/<down> inserts the completion without any selection,
>   like M-<up>/M-<down> currently does in Emacs.  One ESC clears the
>   inserted string, another ESC closes the completions window and clears
>   the address bar.
>
Yes but there are three key differences there: 

1) browsers show the completion list immediately (like icomplete and
it's family), so they don't require a tab to show the completion list or
any binding to jump to/exit the completions list either.

2) the browser completions are shown vertically only, so no horizontal
navigation is needed and not modifiers to the keys are needed either as
there is not any collision of bindings. With the plus that the user can
go to the initial prompt (without completions) just by moving to the
first candidate (up arrow)... so no applicable to us either.

3) The search they perform is on the history, so when the candidate is
unique it is inserted and selected, so easier to erase the suffix if
needed with backspace or insert at the end (right arrow).

In either case 1) there is not a two step to insert+execute 2) there are
not special bindings 3) There is an intuitive way to keep the
completions like it started (remove the suffix) either hiding or keeping
the completion window.

Maybe we must look more at the fish/zsh behaviors than browsers, because
browsers are too far from our infrastructure...

BTW: do we have any sort of history search based on the inserted text
like bash history-search-backward??

>>> But what about M-<left>/M-<right> for not one-column format?
>>
>> This just confirms me that the initial approach implemented with a minor
>> mode (or using a set-transient-map) may be a solution.
>
>We started with non-intrusive keybindings.  But indeed, more intrusive keys
>should be enabled only depending on a new customizable option.
>

>Here is the next patch that does this and allows using all arrow keys
>only when the completions window is visible:
>
I will try this and comment, thanks!!

Best



  parent reply	other threads:[~2022-04-06 17:45 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220401153839.idrzrbfl2yfzga3y.ref@Ergus>
2022-04-01 15:38 ` Other details about completion Ergus
2022-04-01 16:21   ` Eli Zaretskii
2022-04-01 16:43   ` Juri Linkov
2022-04-01 16:45     ` Ergus
2022-04-01 20:24     ` [PATCH] " Ergus
2022-04-02 18:09       ` Juri Linkov
2022-04-03  0:39         ` Ergus
2022-04-04 19:35       ` Ergus
2022-04-04 19:45         ` Juri Linkov
2022-04-04 20:31           ` Philip Kaludercic
2022-04-05 11:06             ` Ergus
2022-04-04 22:33           ` Ergus
2022-04-05 19:22             ` Juri Linkov
2022-04-05 23:20               ` Ergus
2022-04-06  7:35                 ` Juri Linkov
2022-04-06 13:21                   ` Ergus
2022-04-06 16:48                     ` Juri Linkov
2022-04-06 17:45                       ` [External] : " Drew Adams
2022-04-06 18:25                         ` Juri Linkov
2022-04-06 20:01                           ` Drew Adams
2022-04-06 17:45                       ` Ergus [this message]
2022-04-06 18:29                         ` Juri Linkov
2022-04-06 19:50                           ` Ergus
2022-04-07  7:35                             ` Juri Linkov
2022-04-07  9:16                               ` Ergus
2022-04-07 16:53                                 ` Juri Linkov
2022-04-07 17:38                                   ` Ergus
2022-04-07 18:04                                     ` Juri Linkov
2022-04-07 18:35                                       ` Ergus
2022-04-08  7:40                                         ` Juri Linkov
2022-04-08  8:42                                           ` Ergus
2022-04-08 16:20                                             ` [External] : " Drew Adams
2022-04-08 16:46                                             ` Juri Linkov
2022-04-08  9:31                                           ` Philip Kaludercic
2022-04-08 16:20                                             ` [External] : " Drew Adams
2022-04-08 16:51                                             ` Juri Linkov
2022-04-08 20:12                                               ` Philip Kaludercic
2022-04-06 23:55                           ` Ergus
2022-04-06 18:13                       ` Ergus
2022-04-06 18:34                         ` Juri Linkov
2022-04-06 20:34                           ` Ergus
2022-04-07  7:39                             ` Juri Linkov
2022-04-07  9:08                               ` Ergus
2022-04-07 16:50                                 ` Juri Linkov
2022-04-07 17:22                                   ` Ergus
2022-04-07 17:57                                     ` Juri Linkov
2022-04-07 18:27                                       ` Ergus
2022-04-08  7:45                                         ` Juri Linkov
2022-04-08  8:46                                           ` Ergus
2022-04-08 16:20                                             ` [External] : " Drew Adams
2022-04-08 16:53                                             ` Juri Linkov
2022-04-06  9:07                 ` Lars Ingebrigtsen
2022-04-06 16:43                   ` Juri Linkov
2022-04-07 11:09                     ` Lars Ingebrigtsen
2022-04-07 16:46                       ` Juri Linkov
2022-04-08 12:59                         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220406174532.chsgqkzd2gphyuh3@Ergus \
    --to=spacibba@aol.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).