From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@uni-duisburg.de (Kai =?iso-8859-1?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: Docstring for define-key Date: Wed, 19 Feb 2003 17:31:19 +0100 Organization: University of Duisburg, Germany Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <84adgsjkq0.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1045673550 9569 80.91.224.249 (19 Feb 2003 16:52:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 19 Feb 2003 16:52:30 +0000 (UTC) Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18lXRa-0002QZ-00 for ; Wed, 19 Feb 2003 17:51:38 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18lXeh-00055o-00 for ; Wed, 19 Feb 2003 18:05:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18lXPu-0000l8-05 for emacs-devel@quimby.gnus.org; Wed, 19 Feb 2003 11:49:54 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18lXMI-0008HJ-00 for emacs-devel@gnu.org; Wed, 19 Feb 2003 11:46:10 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18lXGJ-0005kk-00 for emacs-devel@gnu.org; Wed, 19 Feb 2003 11:39:59 -0500 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18lXAq-0003gL-00 for emacs-devel@gnu.org; Wed, 19 Feb 2003 11:34:20 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18lX9Y-0000ty-00 for ; Wed, 19 Feb 2003 17:33:00 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18lX8o-0000qL-00 for ; Wed, 19 Feb 2003 17:32:14 +0100 Original-Lines: 22 Original-X-Complaints-To: usenet@main.gmane.org User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.3.50 Cancel-Lock: sha1:Rx1QsgE4hPPYFNNtnIH6Z/S+FI4= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:11766 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:11766 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