[Top][All Lists]

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

Re: Weired side-effect of using the remap feature in keymaps

From: Richard Stallman
Subject: Re: Weired side-effect of using the remap feature in keymaps
Date: Fri, 30 Mar 2007 17:23:01 -0400

    1. Start Emacs with emacs -Q

    2. Evaluate the following Lisp code:

             ;; Define a keymap
             (defvar my-dummy-map (make-keymap))

             ;; Now use the remap feature to remap delete-backward-char
             (define-key my-dummy-map
               (vector 'remap 'delete-backward-char) 'backward-char)

             ;; Create a buffer and actually install that map.  This step
             ;; seems to be necessary for the bug to occcur.
             (switch-to-buffer (get-buffer-create "foo"))
             (use-local-map my-dummy-map)

    3. Now, start calc with `M-x calc RET'.

    4. If you now check the definition of the DEL key, for example with
        `C-h k DEL', you will see that in calc-mode, this key is now bound
        to `backward-char', even though the remapping was done in
        `my-dummy-map'.  When calc binds the DEL key, it actually scans the
        global map for any key bound to `delete-backward-char' using

          (where-is-internal 'delete-backward-char global-map)

        This search seems to fail after the code above, i.e. something
        seems to have changed in global map which should not have changed.

Nothing has changed in global-map.  When I do the same call to
where-is-internal in some other buffer, it correctly returns ([127]).

So it seems there is a bug in where-is-internal.  When called that way,
it ought to ignore the local map, but it does not.

Can someone fix this bug, then ack?

reply via email to

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