vile
[Top][All Lists]
Advanced

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

Re: [vile] Minibuffer bindings


From: Thomas Dickey
Subject: Re: [vile] Minibuffer bindings
Date: Wed, 30 Jul 2008 09:20:19 -0400 (EDT)

On Tue, 29 Jul 2008, Decklin Foster wrote:

Thomas Dickey writes:

It's supposed-to make bindings in any of the non-default maps override
the default map.  (If not, it's a bug).

It meaning the cmdmode map? Can you give an example of what this could
be useful for? I don't think I quite get it (sorry).

"It" meaning vile's behavior for the various flavors of cmdmode/insmode/select should let those override the default.

Can I somehow remove my weirdo ^N/^P bindings just for the case of
editing history? Or can I get them in normal mode without touching the
default map, thus leaving the history-scrolling intact? cmdmode didn't
seem to do that.

It looks like cmdmode only touches the behavior in mini-edit...

But insmode only applies to regular buffers.

The default editing of the command-line is essentially hardcoded (aside from
the characters you can see with show-terminal-chars).  Likewise the history
mechanism.  That's partly because they're very specialized editing modules
that do things like name-completion.

I guess this is my problem; I want to bind arbitrary things in the history
editor, which it was not really designed for.

right: like the original command-line, it has some hardcoded (or not very
flexible) behavior.  vile's able to check that different bindings resolve
to the same internal function, and does that (not always, but when we've
considered it).  That's why it's checking the CMD_U_FUNC() value.

(This was all motivated by not wanting to reach for the arrow keys, which
do of course always work. But they require using an Fn key on my Happy
Hacking Keyboard.)

I think that would be done up in input.c - though making the seams between
input.c and history.c not visible does take work.

How crazy would it be to make a "mode" for history as well as insert,
and everything a bindable function? To take a simpler example...

It's not a _lot_ of work to make a history-flavor of bindings.

That's just to build the tables of course. There are scattered uses of up/down arrow such as in history.c that would have to be massaged to use the bindings.

On a similar vein, I seem to recall someone asking if we could have
bindings specific to a majormode (or to a buffer).  I was thinking
about that with the changes that I made to hyperlink the target for
which-keywords.

In insert mode, when I turned insert-exec on, I could still use ^T to
indent but not ^D to outdent, because ^D is of course normally bound
to next-half-page. I looked in the docs and it appears that the normal
indentation operations are not functions, but hardcoded somewhere.

yes - the tocntrl('D') and tocntrl('T') uses in insert.c

They should be made (at least) terminal-chars settable.

Also, hitting enter stopped working. I was able to fix things with this:

 ; among other things...
 unbind-insmode-key ^D
 unbind-insmode-key ^M

With no bindings, they fell back to the "default" special meanings, but
it seems to me that these operations could theoretically be functions
bound to those keys (so that there would not need to be insert-exec mode
at all; it would be as if it were always on). The insmode map would have
to not inherit anything from the default map (why does it do that now?).

It inherits from the default since that seemed to be the best way to design it (most of the bindings are the same).

(Actually, binding ^M to newline worked, which is an example of how
I am imagining this working.)

Similarly, all the specialized stuff in the history editor like tab
completion is not exposed as functions. This is surely much hairier,
because of all the interactive prompts and stuff, but maybe (possibly?)
it could be implemented in the same way. It might be nice to be able to
bind tab to some kind of completion in regular old insert mode.

It might be (right now, it's just settable as a terminal-chars, which
is better than nothing ;-)

I guess you could consider this a feature request, but (due to all the
things that would need to be torn up) not one I'd expect this decade :-)
If you think abolishing insert-exec (because we have insmode bindings)
is reasonable but not a priority, I could try to give it a shot someday
when I have time.

--
things change.
address@hidden


_______________________________________________
vile mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/vile


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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