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: Stefan Monnier <monnier@iro.umontreal.ca>,
	Drew Adams <drew.adams@oracle.com>,
	emacs-devel@gnu.org
Subject: Re: feature/completions-highlight-modifications e3c5b99 3/6: Add completions-highlight-mode initial implementation.
Date: Sun, 22 Nov 2020 14:28:33 +0100	[thread overview]
Message-ID: <20201122132833.g44h66g7d4fgnm3s@Ergus> (raw)
In-Reply-To: <871rgmwt6e.fsf@mail.linkov.net>

On Sat, Nov 21, 2020 at 09:30:17PM +0200, Juri Linkov wrote:
>>>> Maybe we should look more how zsh behaves... and try to mimic that as
>>>> much as possible. Because it is already pretty consisten
>>>
>>>Does zsh use arrow keys to navigate in completions?
>>>How then it's possible to get previous/next history item (up/down arrows),
>>>and move the cursor in the command line (left/right arrows)?
>>
>> Similar to what we are doing.
>>
>> 1) When NO completions shown: previous/next history and so on.
>> 2) When completions are shown: navigate completions.
>>
>> Completions are only shown after a "tab request" 1->2 (unlike
>> incomplete)
>
>Trying to mimic the 'zsh' behavior is a good thing.  Using
>'zsh' as a reference, what do you think about naming the package
>'zcomplete'.
>
Ok

>> If you type any letter completions disappear, inserts a space and then
>> the letter, so
>>
>> backspace just hides completions (deletes the inserted space), so goes
>> from 2->1 easily (unlike *Completions*).
>
>If you want to emulate the 'zsh' behavior, then much simpler approach
>would be to allow TAB to pop-up the completions buffer, i.e. to display
>and switch to it.  Then all motion keys will be available by default.
>To display the cursor in the minibuffer is still possible by using
>'(cursor-in-echo-area t)'.  RET will insert the completion under point
>to the minibuffer.  Any self-inserting key could switch back
>to the minibuffer and insert its character.
>
The real issue with that is not setting, but reseting. Because
completions-list-map uses:

1. \e\e\e delete-completion-window
2. q quit-window
3. z kill-current-buffer

to exit. In principle quit-window-hook works for 2. But for 1 we need
an advise and rebind q and 3 is bind to z. so 

I am not clear what's the best approach or the consequences of changing
them. But my proposal will be then make:
q and z: self-insert (as they will call quit-window in the hook any way).

And rebind
C-g: to kill-current-buffer. (I don't really know the difference between
all them)

The hook for self-insert is trivial. But it won't cover commands like
delete-backward-char, backward-kill-word and so on.

The trick there may be to throw the read-only error and call 1, 2 or
3... to go to the minibuffer when any command tries to modify
"Completions* and try to execute there.

But I don't know if it is possible to do that for a whole buffer or a
map in a clean way and locally to a window/buffer only. Is it?





  reply	other threads:[~2020-11-22 13:28 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20201115023629.19537.77471@vcs0.savannah.gnu.org>
     [not found] ` <20201115023631.C78AB20A27@vcs0.savannah.gnu.org>
2020-11-15 18:41   ` feature/completions-highlight-modifications e3c5b99 3/6: Add completions-highlight-mode initial implementation Stefan Monnier
2020-11-15 22:49     ` Ergus
2020-11-15 23:32       ` Stefan Monnier
2020-11-16  3:37         ` Ergus
2020-11-16  3:56           ` Stefan Monnier
2020-11-16  5:40             ` Drew Adams
2020-11-16  7:39             ` Ergus
2020-11-16  5:38           ` Drew Adams
2020-11-16  8:54             ` Juri Linkov
2020-11-16 10:27               ` Ergus
2020-11-16 20:23                 ` Juri Linkov
2020-11-16 21:16                   ` Drew Adams
2020-11-17  0:46                   ` Ergus
2020-11-17 20:02                     ` Juri Linkov
2020-11-17 20:52                       ` Drew Adams
2020-11-18 19:43                 ` Juri Linkov
2020-11-18 22:45                   ` Drew Adams
2020-11-19  3:25                   ` Ergus
2020-11-19  7:45                     ` Juri Linkov
2020-11-19 10:50                       ` Ergus
2020-11-20  9:32                         ` Juri Linkov
     [not found]                           ` <20201120145248.wmbv2zgbvs7bg25i@Ergus>
2020-11-21 19:30                             ` Juri Linkov
2020-11-22 13:28                               ` Ergus [this message]
2020-11-22 20:03                                 ` Juri Linkov
2020-11-22 23:09                               ` Ergus
2020-11-23  9:14                                 ` Juri Linkov
2020-11-23 11:46                                   ` Ergus
2020-11-23 14:13                                     ` Jean Louis
2020-11-23 19:12                                       ` Eli Zaretskii
2020-11-23 19:44                                         ` Jean Louis
2020-11-23 20:54                                     ` Dmitry Gutov
2020-11-23 23:27                                       ` Ergus via Emacs development discussions.
2020-12-10  1:16                                         ` Dmitry Gutov
2020-12-10  8:23                                           ` Juri Linkov
2020-11-25  8:49                                     ` Juri Linkov
2020-11-20 14:24                         ` Stefan Monnier
     [not found]                           ` <20201120144940.p55brblxpuowslag@Ergus>
2020-11-20 15:15                             ` Stefan Monnier
2020-11-16 16:03               ` Drew Adams
2020-11-16 20:28                 ` Juri Linkov
2020-11-16 21:31                   ` Drew Adams
2020-11-18 19:30                   ` Juri Linkov

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=20201122132833.g44h66g7d4fgnm3s@Ergus \
    --to=spacibba@aol.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    /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).