[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vertical fido-mode (new branch)

From: Stefan Monnier
Subject: Re: vertical fido-mode (new branch)
Date: Wed, 26 Aug 2020 09:30:33 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> This is exactly what I did ;p thanks for the name cause mine was worst.

Great minds think alike.

> I have 2 questions:
> 1) Why the function needs to return nil if the return value of
> completion--in-region-1 is not used anywhere so far?

IIRC the value can be used to decide whether completion took place or not.
It's mostly a left over from older completion code where this convention
was used to try various completions in turn.

> 2) What's the "canonical method" to add a keymap to the minibuffer
> (and *Completions*) when enabling the mode but restoring it cleanly at
> the end?

A minor mode?

> Is it possible to do something like push/pop a keymap to another?

You can do that too, e.g. use `current-local-map` to get the current
keymap, then `make-composed-map` to combine it with your new keymap,
then `use-local-map` to make that new composed keymap be the keymap to use.

For pop, it can be a bit trickier if you want to be careful and handle
interaction with other packages doing similar things, but it's not
too bad.

You can look at `internal-push-keymap` and `internal-pop-keymap`
for inspiration.  Maybe we could clean those up and promote them out of
the "internal-" namespace.

> How can I restrict the mode-keymap to the minibuffer for example?

Not sure what you mean by that.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]