[Top][All Lists]

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

Re: The new keymap functions

From: Lars Ingebrigtsen
Subject: Re: The new keymap functions
Date: Sun, 14 Nov 2021 19:00:14 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> We presumably want to keep doing this for backwards compatibility, so I
>> guess adding a new optional parameter to `define-key' to really set it
>> to nil if requested is the way to go?  (And the same in the sparse-map
>> case.)
> That's right: the best way to write a "remove key-binding" function is
> most likely to make `define-key` accept a special
> `:internal-remove-binding` value for the binding: for char-tables and
> arrays you can just make it store a nil in the table, and for cons
> cells, it should remove the cons-cell (which will probably require more
> changes to the code, tho maybe you can get away with calling `delq` to
> remove the cons cell rather than having to remember the previous
> cons-cell so your can `setcdr` it).

Yup.  But I added a REMOVE parameter to `define-key' instead -- that
seems cleaner than a new magical value.

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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