emacs-devel
[Top][All Lists]
Advanced

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

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


From: Carsten Dominik
Subject: Re: Weired side-effect of using the remap feature in keymaps
Date: Fri, 30 Mar 2007 23:40:02 +0200


On Mar 30, 2007, at 23:23, Richard Stallman wrote:

    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]).

I forgot to mention this:  I tried the same, and also found that it
would return ([127]).  However, when running the *compiled* calc.elc,
it returns nil.

- Carsten





reply via email to

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