all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* current-active-maps doesn't look at emulation-mode-map-alists, why?
@ 2016-12-23  4:02 Noam Postavsky
  2016-12-24  0:56 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Noam Postavsky @ 2016-12-23  4:02 UTC (permalink / raw)
  To: Emacs developers

Any reason why current-active-maps doesn't return keymaps from
emulation-mode-map-alists?



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

* Re: current-active-maps doesn't look at emulation-mode-map-alists, why?
  2016-12-23  4:02 current-active-maps doesn't look at emulation-mode-map-alists, why? Noam Postavsky
@ 2016-12-24  0:56 ` Stefan Monnier
  2016-12-26 20:50   ` Noam Postavsky
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2016-12-24  0:56 UTC (permalink / raw)
  To: emacs-devel

> Any reason why current-active-maps doesn't return keymaps from
> emulation-mode-map-alists?

The most likely explanation is that this is a bug introduced when
emulation-mode-map-alists was added.

The intention was really to make all code that uses the active keymaps
(such as read-key-sequence or the computation of menubars and toolbars)
get it from current-active-maps, but this never happened, so we still
have that code duplication.


        Stefan




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

* Re: current-active-maps doesn't look at emulation-mode-map-alists, why?
  2016-12-24  0:56 ` Stefan Monnier
@ 2016-12-26 20:50   ` Noam Postavsky
  2016-12-27  1:50     ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Noam Postavsky @ 2016-12-26 20:50 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers

On Fri, Dec 23, 2016 at 7:56 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> Any reason why current-active-maps doesn't return keymaps from
>> emulation-mode-map-alists?
>
> The most likely explanation is that this is a bug introduced when
> emulation-mode-map-alists was added.
>
> The intention was really to make all code that uses the active keymaps
> (such as read-key-sequence or the computation of menubars and toolbars)
> get it from current-active-maps, but this never happened, so we still
> have that code duplication.
>

read-key-sequence does use current-active-maps, not sure about
menubars and toolbars (what code is that?)

Fread_key_sequence
  return read_key_sequence_vs (prompt, continue_echo, dont_downcase_last,
read_key_sequence_vs
  i = read_key_sequence (keybuf, ARRAYELTS (keybuf),
read_key_sequence
  current_binding = active_maps (first_event);
active_maps
  return Fcons (Qkeymap, Fcurrent_active_maps (Qt, position));



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

* Re: current-active-maps doesn't look at emulation-mode-map-alists, why?
  2016-12-26 20:50   ` Noam Postavsky
@ 2016-12-27  1:50     ` Stefan Monnier
  2016-12-27  3:04       ` Noam Postavsky
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2016-12-27  1:50 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Emacs developers

>>> Any reason why current-active-maps doesn't return keymaps from
>>> emulation-mode-map-alists?

What makes you think it doesn't?


        Stefan



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

* Re: current-active-maps doesn't look at emulation-mode-map-alists, why?
  2016-12-27  1:50     ` Stefan Monnier
@ 2016-12-27  3:04       ` Noam Postavsky
  0 siblings, 0 replies; 5+ messages in thread
From: Noam Postavsky @ 2016-12-27  3:04 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs developers

On Mon, Dec 26, 2016 at 8:50 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>>>> Any reason why current-active-maps doesn't return keymaps from
>>>> emulation-mode-map-alists?
>
> What makes you think it doesn't?

Oops. It was a mixup on my end. I had a test where `key-binding'
wasn't returning what I expected and I missed that current_minor_maps
checks emulation-mode-map-alists. So I made a wrapping function which
overrides `this-command-keys-vector' and adds the keymaps from
emulation-mode-map-alists explicitly. But in fact, that second thing
is 100% redundant (the first is needed because I have a binding to
(menu-item ... :filter ...) where the filter uses
`this-command-keys-vector' to make its decision).

Sorry for the noise.



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

end of thread, other threads:[~2016-12-27  3:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-23  4:02 current-active-maps doesn't look at emulation-mode-map-alists, why? Noam Postavsky
2016-12-24  0:56 ` Stefan Monnier
2016-12-26 20:50   ` Noam Postavsky
2016-12-27  1:50     ` Stefan Monnier
2016-12-27  3:04       ` Noam Postavsky

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.