[Top][All Lists]

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

Re: Making a key undefined again

From: Stefan Monnier
Subject: Re: Making a key undefined again
Date: Mon, 25 Oct 2021 13:31:33 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

>     (defun kmu-remove-key (keymap key)
>       (if (= (length key) 1)
>           (delete key keymap)

This means that it can also affect a parent keymap.
In my book this is an absolute no-no: you should never be able to modify
the parent when accessed from a child.

Also, AFAIK the only difference between a nil binding and "no binding at
all" is whether it can hide bindings from the parent, but if you also remove
the binding from the parent, then you end up with the same result as a nil
binding, no?

> Maybe the code could be simplified; it has been a long time since
> I wrote that, with a little help from my friends.  But I hope the
> doc-string makes it clear why something like this is desirable.

Actually, it didn't make it clear for me.  I hope I understand the
differences between an `undefined` binding, a `nil ` binding, and no
binding at all, but I don't know why unsetting a key is important and
even less when unsetting it by making it have no binding at all
is necessary.


reply via email to

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