emacs-devel
[Top][All Lists]
Advanced

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

Re: Buffer-local key-translation-map


From: Stefan Monnier
Subject: Re: Buffer-local key-translation-map
Date: Wed, 17 Jan 2024 17:54:50 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> function-key-map can be buffer-local, yes.  But nothing actually uses
> that variable.  Its only use is to set the parent of
> local-function-key-map at startup.

Oh, right.

> This could be changed of course, perhaps by making function-key-map not
> actually the parent of local-function-key-map, and teaching key
> translation that if lookup in local-function-key-map fails, it should do
> lookup in function-key-map.

Maybe, but it can be tricky.  The more reliable way would be to first
create a composed keymap using both `local-function-key-map` and
`function-key-map`, and then look *this* up.

> Or maybe the parent of local-function-key-map could be changed to a
> symbol instead of a direct reference?

But a symbol standard for the keymap in the `symbol-function` slot, not
in the `symbol-value` slot, it still can't be buffer-local.

We could add a similar indirection via `symbol-value`, of course.
Not sure it's worth the trouble (I've toyed with the idea a few times,
but each time, it seemed to cover only some of the needs, and the
remaining problems were still significant, so it wasn't all that
useful, IIRC).


        Stefan




reply via email to

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