[Top][All Lists]

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

Incomplete function documentation for map-keymap and map-keymap strangen

From: David Byers
Subject: Incomplete function documentation for map-keymap and map-keymap strangeness
Date: 11 Jul 2007 22:46:04 +0200

Please describe exactly what actions triggered the bug and the precise
symptoms of the bug:

Two related issues in Gnu Emacs 22.1:

First issue:

The function documentation (C-h f) for map-keymap in Emacs 22.1 states
that the function takes two arguments, FUNCTION and KEYMAP, when in
fact it takes three, FUNCTION, KEYMAP and optional SORT-FIRST.

The SORT-FIRST parameter should be included in the documentation.

Second issue:

When passing t in SORT-FIRST, Fmap_keymap calls map-keymap-internal
(Lisp code), which binds the variable "list". Thus, if the FUNCTION
passed to map-keymap attempts to access the dynamically bound variable
"list", it will in fact access the variable internal to
map-keymap-internal. Try this, for example:

    (let (list)
       (lambda (event binding) (setq list (cons event list)))
       (current-local-map) t)

In lisp interaction mode this should return a short list of integers.
Remove the t and it does. Change the variable name from list to klist
and it does.

I think that map-keymap-internal should be modified to either not bind
anything in the environment of FUNCTION (at least not anything that
FUNCTION might use, and "list" is far too generic), or the
documentation of map-keymap should mention this issue.

In GNU Emacs 22.1.1 (i386-mingw-nt5.1.2600)
 of 2007-06-02 on RELEASE
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --cflags

David Byers.

reply via email to

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