GNU bug report logs - #9293
say what they are shadowed by

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Sat, 13 Aug 2011 13:06:02 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9293 in the body.
You can then email your comments to 9293 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Sat, 13 Aug 2011 13:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to jidanni <at> jidanni.org:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 13 Aug 2011 13:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: jidanni <at> jidanni.org
To: bug-gnu-emacs <at> gnu.org
Subject: say what they are shadowed by
Date: Sat, 13 Aug 2011 21:03:25 +0800
   Tar mode defined in `tar-mode.el':...
   0 .. 9		digit-argument  (binding currently shadowed)

Shadowed by what?

   e .. f		tar-extract  (binding currently shadowed)

   C-d		tar-flag-deleted
   RET		tar-extract
     (that binding is currently shadowed by another mode)
   C-n		tar-next-line
   C-p		tar-previous-line
   SPC		tar-next-line
     (that binding is currently shadowed by another mode)

Say what mode on each of such lines!




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Mon, 22 Aug 2011 21:33:02 GMT) Full text and rfc822 format available.

Message #8 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: jidanni <at> jidanni.org
Cc: 9293 <at> debbugs.gnu.org
Subject: Re: bug#9293: say what they are shadowed by
Date: Mon, 22 Aug 2011 17:29:39 -0400
severity 9293 wishlist
thanks

>    Tar mode defined in `tar-mode.el':...
>    0 .. 9		digit-argument  (binding currently shadowed)

> Shadowed by what?

>    e .. f		tar-extract  (binding currently shadowed)

>    C-d		tar-flag-deleted
>    RET		tar-extract
>      (that binding is currently shadowed by another mode)
>    C-n		tar-next-line
>    C-p		tar-previous-line
>    SPC		tar-next-line
>      (that binding is currently shadowed by another mode)

> Say what mode on each of such lines!

That would be nice, indeed.  In this case, I can guess it's the
view-mode bindings, probably because you used `v' from dired to visit
that file.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Mon, 22 Aug 2011 21:48:01 GMT) Full text and rfc822 format available.

Message #11 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 9293 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: Re: bug#9293: say what they are shadowed by
Date: Mon, 22 Aug 2011 23:44:23 +0200
On Mon, Aug 22, 2011 at 23:29, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> severity 9293 wishlist
> thanks
>
>>    Tar mode defined in `tar-mode.el':...
>>    0 .. 9             digit-argument  (binding currently shadowed)
>
>> Shadowed by what?
>
>>    e .. f             tar-extract  (binding currently shadowed)
>
>>    C-d                tar-flag-deleted
>>    RET                tar-extract
>>      (that binding is currently shadowed by another mode)
>>    C-n                tar-next-line
>>    C-p                tar-previous-line
>>    SPC                tar-next-line
>>      (that binding is currently shadowed by another mode)
>
>> Say what mode on each of such lines!
>
> That would be nice, indeed.

I agree.

I took a look at this quite some time ago now and wrote the command
describe-key-and-map-briefly (which is in ourcomment-utils.el in
nXhtml). This uses some adhod guessing to find the keymap that the
used key is defined in. Perhaps this can be expanded to take care of
the case above too (I am not quite sure at the moment). The command
itself is also useful and might replace describe-key-briefly.

However when writing this command I noticed that there is not enough
information available so some guessing must be done (or the
information must be enhanced somehow, of course).




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Mon, 22 Aug 2011 22:39:02 GMT) Full text and rfc822 format available.

Message #14 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: jidanni <at> jidanni.org
To: monnier <at> iro.umontreal.ca
Cc: 9293 <at> debbugs.gnu.org
Subject: Re: bug#9293: say what they are shadowed by
Date: Tue, 23 Aug 2011 06:36:22 +0800
>>>>> "SM" == Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
SM> That would be nice, indeed.  In this case, I can guess it's the
SM> view-mode bindings, probably because you used `v' from dired to visit
SM> that file.
I guess that is a good guess. But a bad to guess that the users like to guess.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Thu, 08 Sep 2011 15:33:01 GMT) Full text and rfc822 format available.

Message #17 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Le Wang <l26wang <at> gmail.com>
To: lennart.borgman <at> gmail.com
Cc: 9293 <at> debbugs.gnu.org
Subject: bug#9293: say what they are shadowed by
Date: Thu, 8 Sep 2011 23:28:24 +0800
I just wanted to add that I've been bitten by this unhelpful message as well.

I just came across an issue where I made a derived mode based on
diff-mode, but my key bindings were overwridden no matter what I
tried.  Finally I found this bug, and used Lennart's
`describe-key-and-map-briefly', which gave me the information needed
to resolve my issue (I didn't know about
`minor-mode-overriding-map-alist', I should've RTFM).

If the "C-h m" text included this information directly, I would have
avoided a lot of frustration.

Best,
Le




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Fri, 07 Aug 2020 10:28:02 GMT) Full text and rfc822 format available.

Message #20 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: jidanni <at> jidanni.org
Cc: 9293 <at> debbugs.gnu.org
Subject: Re: bug#9293: say what they are shadowed by
Date: Fri, 07 Aug 2020 12:26:53 +0200
jidanni <at> jidanni.org writes:

>    Tar mode defined in `tar-mode.el':...
>    0 .. 9		digit-argument  (binding currently shadowed)
>
> Shadowed by what?
>
>    e .. f		tar-extract  (binding currently shadowed)

[...]

> Say what mode on each of such lines!

This was eight years ago -- has this been fixed in the meantime?

If not -- what are the steps to reproduce this bug?  I'm not getting any
shadowed bindings.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Fri, 07 Aug 2020 13:23:02 GMT) Full text and rfc822 format available.

Message #23 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 9293 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#9293: say what they are shadowed by
Date: Fri, 7 Aug 2020 15:22:12 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> jidanni <at> jidanni.org writes:
>
> >    Tar mode defined in `tar-mode.el':...
> >    0 .. 9             digit-argument  (binding currently shadowed)
> >
> > Shadowed by what?
> >
> >    e .. f             tar-extract  (binding currently shadowed)
>
> [...]
>
> > Say what mode on each of such lines!
>
> This was eight years ago -- has this been fixed in the meantime?

Nope.

> If not -- what are the steps to reproduce this bug?  I'm not getting any
> shadowed bindings.

I am working on the branch scratch/substitute-command-keys to replace
s-c-k with a Lisp version, but I have not had much time lately so
there has been no progress in a couple of months. I can't remember the
current status, but I think there may be some tests for this there. Or
I didn't get to that yet, sorry, I can't remember now.

I hope that this would be easier to fix once we have the Lisp version
of s-c-k (and I would personally prefer not to see any changes to the
C version meanwhile ;-)).

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Sat, 08 Aug 2020 09:11:02 GMT) Full text and rfc822 format available.

Message #26 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 9293 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#9293: say what they are shadowed by
Date: Sat, 08 Aug 2020 11:09:47 +0200
Stefan Kangas <stefan <at> marxist.se> writes:

> I am working on the branch scratch/substitute-command-keys to replace
> s-c-k with a Lisp version, but I have not had much time lately so
> there has been no progress in a couple of months. I can't remember the
> current status, but I think there may be some tests for this there. Or
> I didn't get to that yet, sorry, I can't remember now.
>
> I hope that this would be easier to fix once we have the Lisp version
> of s-c-k (and I would personally prefer not to see any changes to the
> C version meanwhile ;-)).

Yeah, that makes sense.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Wed, 28 Oct 2020 04:55:01 GMT) Full text and rfc822 format available.

Message #29 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 9293 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#9293: say what they are shadowed by
Date: Tue, 27 Oct 2020 21:53:52 -0700
Stefan Kangas <stefan <at> marxist.se> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> jidanni <at> jidanni.org writes:
>>
>> >    Tar mode defined in `tar-mode.el':...
>> >    0 .. 9             digit-argument  (binding currently shadowed)
>> >
>> > Shadowed by what?
>> >
>> >    e .. f             tar-extract  (binding currently shadowed)
>>
>> [...]

Note that the text here is changed to "(this binding is currently
shadowed)", see Bug#14086.

>>
>> > Say what mode on each of such lines!
>>
>> This was eight years ago -- has this been fixed in the meantime?
>
> Nope.
>
>> If not -- what are the steps to reproduce this bug?  I'm not getting any
>> shadowed bindings.
>
> I am working on the branch scratch/substitute-command-keys to replace
> s-c-k with a Lisp version, but I have not had much time lately so
> there has been no progress in a couple of months. I can't remember the
> current status, but I think there may be some tests for this there. Or
> I didn't get to that yet, sorry, I can't remember now.
>
> I hope that this would be easier to fix once we have the Lisp version
> of s-c-k

Contrary to my hopes this part was in fact _not_ converted to Lisp with
the merge of scratch/substitute-command-keys.  This was due to poor
performance of my Lisp version of that code.  So this should be as easy
or hard as it was before to fix.

The text comes from describe_map in keymap.c (at the very end of the
function) if someone wants to take a stab at improving this.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Wed, 28 Oct 2020 11:15:02 GMT) Full text and rfc822 format available.

Message #32 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 9293 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Date: Wed, 28 Oct 2020 12:14:37 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> Contrary to my hopes this part was in fact _not_ converted to Lisp with
> the merge of scratch/substitute-command-keys.  This was due to poor
> performance of my Lisp version of that code.  So this should be as easy
> or hard as it was before to fix.

Right.

So, here's the test case (since one wasn't given in the original bug
report):

C-x C-f file.tgz RET
M-x view-mode RET
C-h m

Notice

key             binding
---             -------

0 .. 9		digit-argument  (binding currently shadowed)
e .. f		tar-extract  (binding currently shadowed)

This is both confusing and...  wrong?

`C-h c e' does say "e runs the command View-exit", but
`C-h c f' says "f runs the command tar-extract".

And all of keys `0' through `9' really do call `digit-argument', so that
one is just totally wrong.

So there's a bug here, and an improvement request in addition.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Fri, 13 Nov 2020 00:29:02 GMT) Full text and rfc822 format available.

Message #35 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 9293 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Date: Thu, 12 Nov 2020 19:28:16 -0500
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> So, here's the test case (since one wasn't given in the original bug
> report):
>
> C-x C-f file.tgz RET
> M-x view-mode RET
> C-h m
>
> Notice
>
> key             binding
> ---             -------
>
> 0 .. 9		digit-argument  (binding currently shadowed)
> e .. f		tar-extract  (binding currently shadowed)
>
> This is both confusing and...  wrong?
>
> `C-h c e' does say "e runs the command View-exit", but
> `C-h c f' says "f runs the command tar-extract".

I think there are two issues:

1. If you don't enable `view-mode', you will see that in `tar-mode-map'
   both `e' and `f' are bound to `tar-extract'.

   However, when you enable `view-mode', only `e' is shadowed.

> And all of keys `0' through `9' really do call `digit-argument', so that
> one is just totally wrong.

2. `0 .. 9' are technically shadowed, in the sense that there is a
   binding for them in an overriding keymap.  Only that in this case the
   binding in the other keymap is the exact same command.

So in conclusion the output here should probably be:

  0 .. 9	digit-argument
  e		tar-extract  (binding currently shadowed)
  f		tar-extract




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Fri, 13 Nov 2020 19:38:02 GMT) Full text and rfc822 format available.

Message #38 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 9293 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#9293: say what they are shadowed by
Date: Fri, 13 Nov 2020 11:37:49 -0800
[Message part 1 (text/plain, inline)]
tags 9293 + patch
thanks

Stefan Kangas <stefan <at> marxist.se> writes:

> So in conclusion the output here should probably be:
>
>   0 .. 9	digit-argument
>   e		tar-extract  (binding currently shadowed)
>   f		tar-extract

I've attached three patches.  The first fixes the bug with broken
ranges, the second one fixes the incorrect shadowing by the same
command, and the third one takes care of the feature request.

Using the original recipe, I now get:

0 .. 9		digit-argument
e		tar-extract  (currently shadowed by ‘View-exit’)
f		tar-extract

Comments?
[0001-Don-t-show-key-ranges-if-shadowed-by-different-comma.patch (text/x-diff, attachment)]
[0002-Don-t-shadow-bindings-by-the-same-command.patch (text/x-diff, attachment)]
[0003-Say-which-command-shadows-a-key-binding.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Fri, 13 Nov 2020 19:38:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Sat, 14 Nov 2020 15:53:01 GMT) Full text and rfc822 format available.

Message #43 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 9293 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#9293: say what they are shadowed by
Date: Sat, 14 Nov 2020 16:52:39 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> I've attached three patches.  The first fixes the bug with broken
> ranges, the second one fixes the incorrect shadowing by the same
> command, and the third one takes care of the feature request.
>
> Using the original recipe, I now get:
>
> 0 .. 9		digit-argument
> e		tar-extract  (currently shadowed by ‘View-exit’)
> f		tar-extract
>
> Comments?

Looks perfect; go ahead and push.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9293; Package emacs. (Sun, 22 Nov 2020 02:28:02 GMT) Full text and rfc822 format available.

Message #46 received at 9293 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 9293 <at> debbugs.gnu.org,
 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: Re: bug#9293: say what they are shadowed by
Date: Sat, 21 Nov 2020 18:27:25 -0800
tags 9293 fixed
close 9293 28.1
thanks

Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> I've attached three patches.  The first fixes the bug with broken
>> ranges, the second one fixes the incorrect shadowing by the same
>> command, and the third one takes care of the feature request.
>>
>> Using the original recipe, I now get:
>>
>> 0 .. 9		digit-argument
>> e		tar-extract  (currently shadowed by ‘View-exit’)
>> f		tar-extract
>>
>> Comments?
>
> Looks perfect; go ahead and push.

Thanks.

No further comments within a week; pushed to master and closing.




Added tag(s) fixed. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 22 Nov 2020 02:28:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 9293 <at> debbugs.gnu.org and jidanni <at> jidanni.org Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 22 Nov 2020 02:28:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 20 Dec 2020 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 120 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.