[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (that binding is currently shadowed ...)
From: |
Kim F. Storm |
Subject: |
Re: (that binding is currently shadowed ...) |
Date: |
Mon, 22 Jan 2007 21:08:55 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux) |
"Lennart Borgman (gmail)" <address@hidden> writes:
> If cua-mode is enabled and you define a minor mode using C-c as a
> prefix key you describe-bindings wrongly says that C-c is
> shadowed. This is quite disturbing since C-c by some of the
> punctuation characters is what a minor mode is supposed to use (my
> example uses C-c RET which is a bit bad). Here is how the output can
> look:
>
> key binding
> --- -------
>
> C-c Prefix Command
> (that binding is currently shadowed by another mode)
>
Here is a patch which fixes this problem. I'm not sure whether it
has any bad effects in other cases. Stefan?
*** keymap.c 21 Jan 2007 21:53:58 +0100 1.344
--- keymap.c 22 Jan 2007 20:57:29 +0100
***************
*** 3456,3464 ****
if (!NILP (tem))
{
/* Avoid generating duplicate entries if the
! shadowed binding has the same definition. */
if (mention_shadow && !EQ (tem, definition))
! this_shadowed = 1;
else
continue;
}
--- 3456,3467 ----
if (!NILP (tem))
{
/* Avoid generating duplicate entries if the
! shadowed binding has the same definition.
! */
if (mention_shadow && !EQ (tem, definition))
! /* If both bindings are keymaps, it's a prefix key, so
! don't say it is shadowed. */
! this_shadowed = !(KEYMAPP (definition) && KEYMAPP (tem));
else
continue;
}
> C-c RET Prefix Command
>
>
> Here is an example to use to reproduce it. Start with
>
> emacs -Q
> M-x cua-mode
>
> Then eval the code below and do
>
> M-x mlinks-mode
> C-h f mlinks-mode RET
>
> (defvar mlinks-mode-map
> (let ((m (make-sparse-keymap)))
> (define-key m [(control ?c) ?\r ?\r] 'mlinks-goto)
> (define-key m [(control ?c) ?\r ?n] 'mlinks-next)
> (define-key m [(control ?c) ?\r ?p] 'mlinks-prev)
> (define-key m [(control ?c) ?\r ?h] 'mlinks-toggle-highlighter)
> m))
>
> (define-minor-mode mlinks-mode
> "
> \\{mlinks-mode-map}
> "
> nil
> " ML"
> nil
> :global t
> :keymap mlinks-mode-map
> :group 'mlinks)
>
>
> In GNU Emacs 22.0.92.1 (i386-mingw-nt5.1.2600)
> of 2007-01-20
--
Kim F. Storm <address@hidden> http://www.cua.dk