unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#8350: 24.0.50; wrong bindings for remapped keys
@ 2011-03-26 20:00 Drew Adams
  2011-03-27 21:19 ` Stefan Monnier
  2011-05-29 19:00 ` Chong Yidong
  0 siblings, 2 replies; 10+ messages in thread
From: Drew Adams @ 2011-03-26 20:00 UTC (permalink / raw)
  To: 8350

(define-key ctl-x-map "f" 'forward-char)
 
C-h w forward-char   (says that it is bound to C-x f)
 
(define-key ctl-x-map [remap forward-char] 'backward-char)
 
C-h w forward-char   (says that it is still bound to C-x f)
C-h w backward-char  (says that it is bound to C-x <remap>
                      <forward-char>)
 
(command-remapping 'forward-char nil (list ctl-x-map))
  => backward-char
 
C-x f                (moves forward, not backward a character;
                      `backward-char' is not invoked)
 
C-x C-h              (says C-x f is bound to `forward-char')
 
Looking at (elisp) Remapping Commands I do not see how/why this should
be.  Seems like this should just work (as the doc indicates).
 
 
 
In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-03-21 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt --cflags
-Ic:/imagesupport/include'
 






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

* bug#8350: 24.0.50; wrong bindings for remapped keys
  2011-03-26 20:00 bug#8350: 24.0.50; wrong bindings for remapped keys Drew Adams
@ 2011-03-27 21:19 ` Stefan Monnier
  2011-03-27 21:51   ` Drew Adams
  2011-05-29 19:00 ` Chong Yidong
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2011-03-27 21:19 UTC (permalink / raw)
  To: Drew Adams; +Cc: 8350

> (define-key ctl-x-map [remap forward-char] 'backward-char)
[...] 
> (command-remapping 'forward-char nil (list ctl-x-map))
>   => backward-char
 
But ctl-x-map is never used as one of the active maps, it's always
limited to being a prefix map bound to C-x, so the define-key above will
have pretty much no effect.


        Stefan





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

* bug#8350: 24.0.50; wrong bindings for remapped keys
  2011-03-27 21:19 ` Stefan Monnier
@ 2011-03-27 21:51   ` Drew Adams
  2011-03-28 14:22     ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2011-03-27 21:51 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: 8350

> > (define-key ctl-x-map [remap forward-char] 'backward-char)
> > C-x C-h (says C-x f is bound to `forward-char')
>  
> But ctl-x-map is never used as one of the active maps, it's always
> limited to being a prefix map bound to C-x, so the define-key 
> above will have pretty much no effect.

It was a simplified example.  And whether `ctl-x-map' is used as an active map
is irrelevant, I think, to the bugged behavior wrt `PREFIX-KEY C-h' described
here.

In any case, in my own use, where I uncovered this, the keymap is not
`ctl-x-map', just as the commands are not `forward-char' and `backward-char'.

In my use, `bmkp-this-buffer-jump', for example, is remapped to
`icicle-bookmark-this-buffer' in `icicle-mode-map' (a minor mode map).  And the
remapping works as expected - `icicle-bookmark-this-buffer' gets called.

And all of the help output is correct - except for `PREFIX-KEY C-h'.

`C-h w bmkp-this-buffer-jump' says:

"bmkp-this-buffer-jump is remapped to icicle-bookmark-this-buffer which is on
C-x j ."

`C-h w icicle-bookmark-this-buffer' says:

"icicle-bookmark-this-buffer is on C-x j ."

`C-h f bmkp-this-buffer-jump' says it is remapped to etc., etc.  All of the help
output is correct.  Except the output from `C-x j C-h', which shows this:

"C-x j .         bmkp-this-buffer-jump"

The code defining the initial binding of `bmkp-this-buffer-jump' includes this:

(define-prefix-command 'bmkp-jump-map)
(define-key ctl-x-map "j" bmkp-jump-map)
(define-key bmkp-jump-map "." 'bmkp-this-buffer-jump)






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

* bug#8350: 24.0.50; wrong bindings for remapped keys
  2011-03-27 21:51   ` Drew Adams
@ 2011-03-28 14:22     ` Stefan Monnier
  2011-03-28 15:04       ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2011-03-28 14:22 UTC (permalink / raw)
  To: Drew Adams; +Cc: 8350

forcemerge 6882 8350
thanks

>> > (define-key ctl-x-map [remap forward-char] 'backward-char)
>> > C-x C-h (says C-x f is bound to `forward-char')
>> But ctl-x-map is never used as one of the active maps, it's always
>> limited to being a prefix map bound to C-x, so the define-key 
>> above will have pretty much no effect.

> It was a simplified example.  And whether `ctl-x-map' is used as an
> active map is irrelevant,

Well, since the `remap' is in ctl-x-map it is of crucial importance.

> I think, to the bugged behavior wrt `PREFIX-KEY C-h' described here.

That problem is in bug#6881 and bug#8351 so I don't think it needs
a third bug report.  


        Stefan





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

* bug#8350: 24.0.50; wrong bindings for remapped keys
  2011-03-28 14:22     ` Stefan Monnier
@ 2011-03-28 15:04       ` Drew Adams
  2011-03-28 17:43         ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2011-03-28 15:04 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: 8350

> That problem is in bug#6881 and bug#8351 so I don't think it needs
> a third bug report.  

Granted, 8351 refers to the C-h part of this bug.

If you don't think the rest of 8350 (apart from C-h) represents a bug, OK.






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

* bug#8350: 24.0.50; wrong bindings for remapped keys
  2011-03-28 15:04       ` Drew Adams
@ 2011-03-28 17:43         ` Stefan Monnier
  2011-03-29  4:16           ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2011-03-28 17:43 UTC (permalink / raw)
  To: Drew Adams; +Cc: 8350

>> That problem is in bug#6881 and bug#8351 so I don't think it needs
>> a third bug report.  
> Granted, 8351 refers to the C-h part of this bug.
> If you don't think the rest of 8350 (apart from C-h) represents a bug, OK.

All the rest is explained by the fact that you put the `remap' thing on
a non-top-level keymap, AFAICT.
If not, then please submit a new report that focuses on the
new misbehavior.


        Stefan





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

* bug#8350: 24.0.50; wrong bindings for remapped keys
  2011-03-28 17:43         ` Stefan Monnier
@ 2011-03-29  4:16           ` Drew Adams
  2011-03-29 13:58             ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Drew Adams @ 2011-03-29  4:16 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: 8350

> >> That problem is in bug#6881 and bug#8351 so I don't think it needs
> >> a third bug report.
> > 
> > Granted, 8351 refers to the C-h part of this bug.
> > If you don't think the rest of 8350 (apart from C-h) 
> > represents a bug, OK.
> 
> All the rest is explained by the fact that you put the 
> `remap' thing on a non-top-level keymap, AFAICT.

Yes, I already agreed with you about that.  The question is whether the symptoms
constitute a bug.  It's fine with me if you feel they do not.






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

* bug#8350: 24.0.50; wrong bindings for remapped keys
  2011-03-29  4:16           ` Drew Adams
@ 2011-03-29 13:58             ` Stefan Monnier
  2011-03-29 14:18               ` Drew Adams
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2011-03-29 13:58 UTC (permalink / raw)
  To: Drew Adams; +Cc: 8350

> Yes, I already agreed with you about that.  The question is whether
> the symptoms constitute a bug.  It's fine with me if you feel they
> do not.

I don't know what symptoms you're talking about.


        Stefan





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

* bug#8350: 24.0.50; wrong bindings for remapped keys
  2011-03-29 13:58             ` Stefan Monnier
@ 2011-03-29 14:18               ` Drew Adams
  0 siblings, 0 replies; 10+ messages in thread
From: Drew Adams @ 2011-03-29 14:18 UTC (permalink / raw)
  To: 'Stefan Monnier'; +Cc: 8350

> > Yes, I already agreed with you about that.  The question is whether
> > the symptoms constitute a bug.  It's fine with me if you feel they
> > do not.
> 
> I don't know what symptoms you're talking about.

The behavior described in the bug report, of course.  The symptoms you explained
are manifested because of using `remap' with a non-top-level keymap.  IOW, what
you called "all the rest":

>>> All the rest is explained by the fact that you put the 
>>> `remap' thing on a non-top-level keymap, AFAICT.

If that behavior doesn't constitute a bug in your eyes, as I say, that's fine
with me.  You might nevertheless consider documenting it.  There is nothing in
the doc for `remap' that suggests this, I believe.






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

* bug#8350: 24.0.50; wrong bindings for remapped keys
  2011-03-26 20:00 bug#8350: 24.0.50; wrong bindings for remapped keys Drew Adams
  2011-03-27 21:19 ` Stefan Monnier
@ 2011-05-29 19:00 ` Chong Yidong
  1 sibling, 0 replies; 10+ messages in thread
From: Chong Yidong @ 2011-05-29 19:00 UTC (permalink / raw)
  To: Drew Adams; +Cc: 8350

> If that behavior doesn't constitute a bug in your eyes, as I say,
> that's fine with me.  You might nevertheless consider documenting it.
> There is nothing in the doc for `remap' that suggests this, I believe.

I've edited the Lisp manually to specifically mention this.





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

end of thread, other threads:[~2011-05-29 19:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-26 20:00 bug#8350: 24.0.50; wrong bindings for remapped keys Drew Adams
2011-03-27 21:19 ` Stefan Monnier
2011-03-27 21:51   ` Drew Adams
2011-03-28 14:22     ` Stefan Monnier
2011-03-28 15:04       ` Drew Adams
2011-03-28 17:43         ` Stefan Monnier
2011-03-29  4:16           ` Drew Adams
2011-03-29 13:58             ` Stefan Monnier
2011-03-29 14:18               ` Drew Adams
2011-05-29 19:00 ` Chong Yidong

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