[Top][All Lists]

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

Spurious shell/comint "shadowed bindings" in C-h m

From: Bob Rogers
Subject: Spurious shell/comint "shadowed bindings" in C-h m
Date: Sun, 30 Apr 2006 16:15:56 -0400

   After doing "M-x shell RET C-h m" [1], I noticed a curious thing in
the *Help* buffer output.  All but three C-c and ESC prefix commands
appear twice, with the second appearance identical to the first except
for having a "that binding is shadowed" note after it.  Here is a

        C-c M-r         comint-previous-matching-input-from-input
        C-c M-s         comint-next-matching-input-from-input

        C-c M-r         comint-previous-matching-input-from-input
          (that binding is currently shadowed by another mode)
        C-c M-s         comint-next-matching-input-from-input
          (that binding is currently shadowed by another mode)

The exceptions are M-? (comint-dynamic-list-filename-completions), C-c
C-b (shell-backward-command), and C-c C-f (shell-forward-command).  All
of these three commands are bound in shell-mode-map; if I do "C-x b foo
RET M-x comint-mode RET C-h m", I see the plain comint-mode help, which
does not have this problem.

   Examining shell-mode-map shows that the repeated commands do appear
bound to the same keys twice via list sharing.  You can see this for
yourself by evaluating the following in *scratch*:

        (let ((print-circle t) (print-length nil)
              (standard-output (current-buffer)))
          (prin1 shell-mode-map))

[I won't quote the actual output, though; it's pretty messy.]

   Commenting-out the exceptional shell-mode prefix command bindings
mentioned above (shell-backward-command, shell-forward-command, and
comint-dynamic-list-filename-completions) in the shell-mode-map init
makes all of the repeats disappear, so it looks like define-key is
confusing describe_map by copying some inherited comint-mode-map
bindings when it doesn't have to.  But I'm not fluent enough with the C
source to be willing/able to follow it further.


                                        -- Bob Rogers

[1]  All of this is with CVS HEAD as of 6 hours ago (i686-pc-linux-gnu,
     X toolkit, Xaw3d scroll bars), using "emacs -Q".

reply via email to

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