emacs-devel
[Top][All Lists]
Advanced

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

Docstring for define-key


From: Kai Großjohann
Subject: Docstring for define-key
Date: Wed, 19 Feb 2003 17:31:19 +0100
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50

The docstring for define-key says:

    If KEYMAP is a sparse keymap, the pair binding KEY to DEF is added at
    the front of KEYMAP.

When reading this, one could think that executing the same define-key
statement multiple times makes the KEYMAP grow.  However, this is not
the case.  Glancing at the code, I see that it seems to alter the old
binding, if one is already present.  So one possibility to change it
is like this:

    If KEYMAP is a sparse keymap with a binding for KEY, the existing
    binding is altered.  If there is no binding for KEY, the new pair
    binding KEY to DEF is added at the front of KEYMAP.

The wording is not very good, I think.

Suggestions?  Opinions?

Kudos to David Kastrup for bringing this up.
-- 
A turnip curses Elvis





reply via email to

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