unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Spurious shell/comint "shadowed bindings" in C-h m
@ 2006-04-30 20:15 Bob Rogers
  2006-05-01  4:20 ` Richard Stallman
  2006-05-08 22:29 ` Bug to fix! Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Bob Rogers @ 2006-04-30 20:15 UTC (permalink / raw


   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
sample:

	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.

   HTH,

					-- Bob Rogers
					   http://rgrjr.dyndns.org/

[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".

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Spurious shell/comint "shadowed bindings" in C-h m
  2006-04-30 20:15 Spurious shell/comint "shadowed bindings" in C-h m Bob Rogers
@ 2006-05-01  4:20 ` Richard Stallman
  2006-05-08 22:29 ` Bug to fix! Richard Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2006-05-01  4:20 UTC (permalink / raw
  Cc: emacs-devel

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

This is normal--it is part of the keymap parent mechanism.
shell-mode-map has comint-mode-map as its parent.
So the sub-keymap for C-c in shell-mode-map must also have,
as its parent, the sub-keymap for C-c in comint-mode-map.

So the right fix here is to change the code that generates
the table for C-h m so that it avoids generating duplicate
output in cases like this.

Would someone like to do that?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Bug to fix!
  2006-04-30 20:15 Spurious shell/comint "shadowed bindings" in C-h m Bob Rogers
  2006-05-01  4:20 ` Richard Stallman
@ 2006-05-08 22:29 ` Richard Stallman
  2006-05-09 14:31   ` Chong Yidong
  1 sibling, 1 reply; 6+ messages in thread
From: Richard Stallman @ 2006-05-08 22:29 UTC (permalink / raw
  Cc: emacs-devel

[I sent this message a week ago but did not get a response.]

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

This is normal--it is part of the keymap parent mechanism.
shell-mode-map has comint-mode-map as its parent.
So the sub-keymap for C-c in shell-mode-map must also have,
as its parent, the sub-keymap for C-c in comint-mode-map.

So the right fix here is to change the code that generates
the table for C-h m so that it avoids generating duplicate
output in cases like this.

Would someone like to do that?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug to fix!
  2006-05-08 22:29 ` Bug to fix! Richard Stallman
@ 2006-05-09 14:31   ` Chong Yidong
  2006-05-09 18:43     ` Stefan Monnier
  2006-05-10  3:20     ` Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Chong Yidong @ 2006-05-09 14:31 UTC (permalink / raw
  Cc: Bob Rogers, emacs-devel

>        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))
>
> This is normal--it is part of the keymap parent mechanism.
> shell-mode-map has comint-mode-map as its parent.
> So the sub-keymap for C-c in shell-mode-map must also have,
> as its parent, the sub-keymap for C-c in comint-mode-map.
>
> So the right fix here is to change the code that generates
> the table for C-h m so that it avoids generating duplicate
> output in cases like this.
>
> Would someone like to do that?

I think this patch fixes it.

*** emacs/src/keymap.c~	2006-05-09 10:23:03.000000000 -0400
--- emacs/src/keymap.c	2006-05-09 10:28:59.000000000 -0400
***************
*** 3297,3303 ****
  	      tem = shadow_lookup (shadow, kludge, Qt);
  	      if (!NILP (tem))
  		{
! 		  if (mention_shadow)
  		    this_shadowed = 1;
  		  else
  		    continue;
--- 3297,3303 ----
  	      tem = shadow_lookup (shadow, kludge, Qt);
  	      if (!NILP (tem))
  		{
! 		  if (mention_shadow && !EQ (tem, definition))
  		    this_shadowed = 1;
  		  else
  		    continue;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug to fix!
  2006-05-09 14:31   ` Chong Yidong
@ 2006-05-09 18:43     ` Stefan Monnier
  2006-05-10  3:20     ` Richard Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2006-05-09 18:43 UTC (permalink / raw
  Cc: Bob Rogers, rms, emacs-devel

> I think this patch fixes it.

Whichever patch ends up fixing this, please add a comment explaining why
it's needed.


        Stfean

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Bug to fix!
  2006-05-09 14:31   ` Chong Yidong
  2006-05-09 18:43     ` Stefan Monnier
@ 2006-05-10  3:20     ` Richard Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Stallman @ 2006-05-10  3:20 UTC (permalink / raw
  Cc: rogers-emacs, emacs-devel

It looks plausible--please install it.
Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-05-10  3:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-30 20:15 Spurious shell/comint "shadowed bindings" in C-h m Bob Rogers
2006-05-01  4:20 ` Richard Stallman
2006-05-08 22:29 ` Bug to fix! Richard Stallman
2006-05-09 14:31   ` Chong Yidong
2006-05-09 18:43     ` Stefan Monnier
2006-05-10  3:20     ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).