unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#5040: 23.1; w32-register-hot-key problem
@ 2009-11-25 21:10 Drew Adams
  2009-11-25 21:48 ` Lennart Borgman
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2009-11-25 21:10 UTC (permalink / raw)
  To: bug-gnu-emacs

emacs -Q
M-: (w32-register-hot-key [M-tab])
 
Visit a buffer in emacs-lisp-mode.
Type `forward-', then hit `M-TAB'.
 
The Windows TAB dialog comes up (dunno what you call it - a seqence of
icons; you TAB to cycle among their apps) when you hold down the keys
and then disappears when you release them. It should not not come up
at all; instead, `lisp-complete-symbol' should be executed.
 
However, from then on it works as it should. It is only the first time
you press `M-TAB' that Windows doesn't pass the chord to Emacs.
 
emacs -Q
M-: (w32-register-hot-key [M-tab])
 
Visit a buffer in emacs-lisp-mode.  `C-h k M-TAB'. Same as above: the
Windows TAB dialog comes up and then disappears when you release the
keys. And from then on it works OK.
 
In sum, after evalling (w32-register-hot-key [M-tab]) the first
`M-TAB' should be seen by Emacs, but it is not. Only subsequent
`M-TAB's are seen by Emacs.
 
This worked perfectly in Emacs 20 and 21. It is broken starting with
Emacs 22.
 
 
 
 
 
In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600)
 of 2009-07-29 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4)'
 
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default-enable-multibyte-characters: t
 
Major mode: Emacs-Lisp
 
Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
 
Recent input:
M-: C-y <return> <return> C-h k C-g C-g C-x 1 C-h k 
<M-tab> C-g C-g <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <menu-bar> <help-menu> <se
nd-emacs-bug-report>
 
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
265 (#o411, #x109)
Type C-x 1 to delete the help window.
Quit
Type C-x 1 to delete the help window, C-M-v to scroll help.
Quit
Quit







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

* bug#5040: 23.1; w32-register-hot-key problem
  2009-11-25 21:10 bug#5040: 23.1; w32-register-hot-key problem Drew Adams
@ 2009-11-25 21:48 ` Lennart Borgman
  2009-11-25 21:52   ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2009-11-25 21:48 UTC (permalink / raw)
  To: Drew Adams, 5040; +Cc: bug-gnu-emacs

On Wed, Nov 25, 2009 at 10:10 PM, Drew Adams <drew.adams@oracle.com> wrote:
> emacs -Q
> M-: (w32-register-hot-key [M-tab])
>
> Visit a buffer in emacs-lisp-mode.
> Type `forward-', then hit `M-TAB'.
>
> The Windows TAB dialog comes up (dunno what you call it - a seqence of
> icons; you TAB to cycle among their apps) when you hold down the keys
> and then disappears when you release them. It should not not come up
> at all; instead, `lisp-complete-symbol' should be executed.
>
> However, from then on it works as it should. It is only the first time
> you press `M-TAB' that Windows doesn't pass the chord to Emacs.


This is AFAICS not a bug. M-TAB (and some other keys) can not be
registered as hot keys according to MS documentation.






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

* bug#5040: 23.1; w32-register-hot-key problem
  2009-11-25 21:48 ` Lennart Borgman
@ 2009-11-25 21:52   ` Drew Adams
  2009-11-25 21:55     ` Lennart Borgman
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2009-11-25 21:52 UTC (permalink / raw)
  To: 'Lennart Borgman', 5040; +Cc: bug-gnu-emacs

> On Wed, Nov 25, 2009 at 10:10 PM, Drew Adams 
> <drew.adams@oracle.com> wrote:
> > emacs -Q
> > M-: (w32-register-hot-key [M-tab])
> >
> > Visit a buffer in emacs-lisp-mode.
> > Type `forward-', then hit `M-TAB'.
> >
> > The Windows TAB dialog comes up (dunno what you call it - a 
> > seqence of icons; you TAB to cycle among their apps) when
> > you hold down the keys and then disappears when you release
> > them. It should not not come up at all; instead,
> > `lisp-complete-symbol' should be executed.
> >
> > However, from then on it works as it should. It is only the 
> > first time you press `M-TAB' that Windows doesn't pass the
> > chord to Emacs.
> 
> This is AFAICS not a bug. M-TAB (and some other keys) can not be
> registered as hot keys according to MS documentation.

As I said:

1. It works perfectly after the first time you hit `M-TAB'.

2. It works perfectly in Emacs 20 and 21, even the first time.

So AFAICS what you say is simply not true, at least for me (Windows XP SP3).






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

* bug#5040: 23.1; w32-register-hot-key problem
  2009-11-25 21:52   ` Drew Adams
@ 2009-11-25 21:55     ` Lennart Borgman
  2009-11-25 22:01       ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2009-11-25 21:55 UTC (permalink / raw)
  To: Drew Adams; +Cc: 5040

> As I said:
>
> 1. It works perfectly after the first time you hit `M-TAB'.
>
> 2. It works perfectly in Emacs 20 and 21, even the first time.
>
> So AFAICS what you say is simply not true, at least for me (Windows XP SP3).


Why does it matter that it worked for you before?





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

* bug#5040: 23.1; w32-register-hot-key problem
  2009-11-25 21:55     ` Lennart Borgman
@ 2009-11-25 22:01       ` Drew Adams
  2009-11-25 22:04         ` Lennart Borgman
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2009-11-25 22:01 UTC (permalink / raw)
  To: 'Lennart Borgman'; +Cc: '5040'

> > As I said:
> > 1. It works perfectly after the first time you hit `M-TAB'.
> > 2. It works perfectly in Emacs 20 and 21, even the first time.
> >
> > So AFAICS what you say is simply not true, at least for me 
> > (Windows XP SP3).
> 
> Why does it matter that it worked for you before?

Huh? Who said anything about "before"?

It works for me NOW. And probably for others too.
It works in Emacs 20 and 21 always,
   including the first time I hit `M-TAB'.
It works in Emacs 22 and 23 also,
   EXCEPT for the first time I hit `M-TAB'.

This is a regression starting in Emacs 22. We know it is possible for it to work
starting with the first `M-TAB', because it does (still) work in older Emacs
versions (now, not "before').






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

* bug#5040: 23.1; w32-register-hot-key problem
  2009-11-25 22:01       ` Drew Adams
@ 2009-11-25 22:04         ` Lennart Borgman
  2009-11-25 22:18           ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2009-11-25 22:04 UTC (permalink / raw)
  To: Drew Adams; +Cc: 5040

On Wed, Nov 25, 2009 at 11:01 PM, Drew Adams <drew.adams@oracle.com> wrote:
>> > As I said:
>> > 1. It works perfectly after the first time you hit `M-TAB'.
>> > 2. It works perfectly in Emacs 20 and 21, even the first time.
>> >
>> > So AFAICS what you say is simply not true, at least for me
>> > (Windows XP SP3).
>>
>> Why does it matter that it worked for you before?
>
> Huh? Who said anything about "before"?
>
> It works for me NOW. And probably for others too.
> It works in Emacs 20 and 21 always,
>   including the first time I hit `M-TAB'.
> It works in Emacs 22 and 23 also,
>   EXCEPT for the first time I hit `M-TAB'.
>
> This is a regression starting in Emacs 22. We know it is possible for it to work
> starting with the first `M-TAB', because it does (still) work in older Emacs
> versions (now, not "before').


No, it is not guaranteed to work. If you want to be sure that it works
you need something like the low level keyboard path I have suggested
before.





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

* bug#5040: 23.1; w32-register-hot-key problem
  2009-11-25 22:04         ` Lennart Borgman
@ 2009-11-25 22:18           ` Drew Adams
  2009-11-25 22:24             ` Lennart Borgman
  0 siblings, 1 reply; 9+ messages in thread
From: Drew Adams @ 2009-11-25 22:18 UTC (permalink / raw)
  To: 'Lennart Borgman'; +Cc: '5040'

> >> > As I said:
> >> > 1. It works perfectly after the first time you hit `M-TAB'.
> >> > 2. It works perfectly in Emacs 20 and 21, even the first time.
> >> >
> >> > So AFAICS what you say is simply not true, at least for me
> >> > (Windows XP SP3).
> >>
> >> Why does it matter that it worked for you before?
> >
> > Huh? Who said anything about "before"?
> >
> > It works for me NOW. And probably for others too.
> > It works in Emacs 20 and 21 always,
> >   including the first time I hit `M-TAB'.
> > It works in Emacs 22 and 23 also,
> >   EXCEPT for the first time I hit `M-TAB'.
> >
> > This is a regression starting in Emacs 22. We know it is 
> > possible for it to work starting with the first `M-TAB',
> > because it does (still) work in older Emacs versions (now,
> > not "before').
> 
> > No, it is not guaranteed to work. If you want to be sure that it works
> > you need something like the low level keyboard path I have suggested
> > before.

Lennart, we don't seem to be communicating.
"No", what?  Did I say anything about guarantees?

I said it works FOR ME (Windows XP SP3), and I suspect for at least some others
also. (Have you tried it (with emacs -Q)? Does it work for you? You might be
surprised that it does.)

What is THIS bug report about? There is a minor regression starting with Emacs
22. THAT'S ALL.

Please don't turn this into a discussion/rant about the Windows/Emacs patching
you "have suggested before". All I'm asking for is that this particular bug be
fixed - to make Emacs do again what it did in Emacs 21. Nothing more.

Let's not let the perfect become the enemy of the good. If you want to file
another bug about guarantees, low-level patches, and other things, feel free. I
have no objection to perfection ;-). But while waiting, let's see if this can be
fixed to at least let Emacs do what it did before.







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

* bug#5040: 23.1; w32-register-hot-key problem
  2009-11-25 22:18           ` Drew Adams
@ 2009-11-25 22:24             ` Lennart Borgman
  2011-07-02  2:04               ` Juanma Barranquero
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Borgman @ 2009-11-25 22:24 UTC (permalink / raw)
  To: Drew Adams; +Cc: 5040

On Wed, Nov 25, 2009 at 11:18 PM, Drew Adams <drew.adams@oracle.com> wrote:
>
> Lennart, we don't seem to be communicating.
> "No", what?  Did I say anything about guarantees?
>
> I said it works FOR ME (Windows XP SP3), and I suspect for at least some others
> also. (Have you tried it (with emacs -Q)? Does it work for you? You might be
> surprised that it does.)
>
> What is THIS bug report about? There is a minor regression starting with Emacs
> 22. THAT'S ALL.

I am trying to say that this is not guaranteed to work. Some key
combinations are strictly not allowed by w32 to be used by
applications.

And I think I misremembered. I am not sure if it can work with a low
level keyboard hook either.

There is not very much that we can do to guarantee that it works. If
it works it works a bit by chance. Next patch from MS may stop it from
working.

But you are right, if it works for you with the old versions of Emacs
there might be a way to fool w32 here.





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

* bug#5040: 23.1; w32-register-hot-key problem
  2009-11-25 22:24             ` Lennart Borgman
@ 2011-07-02  2:04               ` Juanma Barranquero
  0 siblings, 0 replies; 9+ messages in thread
From: Juanma Barranquero @ 2011-07-02  2:04 UTC (permalink / raw)
  To: Lennart Borgman, 5040-done

On one hand, Drew is right that if it works with 21.X and 22.X, it
should work with 23.X+.

On the other hand, Lennart's right that Alt-Tab is reserved and, to
make it work reliably it would be necessary to write a low level
keyboard hook.

On the third hand, alt-tab role in Vista and Windows 7 is enhanced and
it does not make much sense to try to bypass it and go against the
system (not that it does not make any sense, just not worth the effort
IMHO). So I'm closing this one.

    Juanma





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

end of thread, other threads:[~2011-07-02  2:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 21:10 bug#5040: 23.1; w32-register-hot-key problem Drew Adams
2009-11-25 21:48 ` Lennart Borgman
2009-11-25 21:52   ` Drew Adams
2009-11-25 21:55     ` Lennart Borgman
2009-11-25 22:01       ` Drew Adams
2009-11-25 22:04         ` Lennart Borgman
2009-11-25 22:18           ` Drew Adams
2009-11-25 22:24             ` Lennart Borgman
2011-07-02  2:04               ` Juanma Barranquero

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