unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Keyboard grabs
@ 2002-04-03  4:56 Richard Stallman
  2002-04-19 20:24 ` Jan D.
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2002-04-03  4:56 UTC (permalink / raw)


Is someone working on making Emacs do a global grab
when it displays a menu?

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

* Re: Keyboard grabs
  2002-04-03  4:56 Keyboard grabs Richard Stallman
@ 2002-04-19 20:24 ` Jan D.
  2002-04-19 21:03   ` Pavel Janík
  2002-04-20 17:27   ` Richard Stallman
  0 siblings, 2 replies; 9+ messages in thread
From: Jan D. @ 2002-04-19 20:24 UTC (permalink / raw)
  Cc: emacs-devel

> 
> Is someone working on making Emacs do a global grab
> when it displays a menu?

If no one is, I can do it.  

On a related note, is there a reason why Emacs
queues keyboard events while menus are mapped?  That is, if I click on
a menu, press "Hello world", and then clicks down the menu, the "Hello world"
is inserted into the current buffer.  I have never seen any application
doing anything like it.  Can that be removed?  I would suspect that
it can lead to surprises if keyboard shortcuts are implemented for menus.
If you hit the wrong key when a menu shortcut was intended, you don't want
that key to go into the buffer later when the menu dissapears.

	Jan D.

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

* Re: Keyboard grabs
  2002-04-19 20:24 ` Jan D.
@ 2002-04-19 21:03   ` Pavel Janík
  2002-04-20  9:48     ` Jan D.
  2002-04-20 17:27   ` Richard Stallman
  1 sibling, 1 reply; 9+ messages in thread
From: Pavel Janík @ 2002-04-19 21:03 UTC (permalink / raw)
  Cc: rms, emacs-devel

   From: "Jan D." <jan.h.d@swipnet.se>
   Date: Fri, 19 Apr 2002 22:24:30 +0200 (MEST)

Hi Jan,

   > On a related note, is there a reason why Emacs
   > queues keyboard events while menus are mapped?  That is, if I click on
   > a menu, press "Hello world", and then clicks down the menu, the "Hello world"
   > is inserted into the current buffer.

this is no longer true for about fifteen minutes ;-) I have committed
a patch which removes that. See my other e-mail.
-- 
Pavel Janík

Don't patch bad code - rewrite it.
                  --  The Elements of Programming Style (Kernighan & Plaugher)

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

* Re: Keyboard grabs
  2002-04-19 21:03   ` Pavel Janík
@ 2002-04-20  9:48     ` Jan D.
  0 siblings, 0 replies; 9+ messages in thread
From: Jan D. @ 2002-04-20  9:48 UTC (permalink / raw)
  Cc: rms, emacs-devel

>    > On a related note, is there a reason why Emacs
>    > queues keyboard events while menus are mapped?  That is, if I click on
>    > a menu, press "Hello world", and then clicks down the menu, the "Hello=
>  world"
>    > is inserted into the current buffer.
> 
> this is no longer true for about fifteen minutes ;-) I have committed
> a patch which removes that. See my other e-mail.

Cool, cvs up:ing now.

	Jan D.

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

* Re: Keyboard grabs
  2002-04-19 20:24 ` Jan D.
  2002-04-19 21:03   ` Pavel Janík
@ 2002-04-20 17:27   ` Richard Stallman
  2002-04-22 18:41     ` Jan D.
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2002-04-20 17:27 UTC (permalink / raw)
  Cc: emacs-devel

    > Is someone working on making Emacs do a global grab
    > when it displays a menu?

    If no one is, I can do it.  

Nobody else is, so I would be grateful if you did that.

      Thus, a keyboard grab to prevent this is the only solution.
    It what other applications (X toolkits really) do.

ISTR that there was some disagreement about that question,
but if it is true that other X apps do a global grab,
please do use that solution.  It is good for Emacs to do
what is familiar.

But there should be a flag which controls whether to do the global
grab.  Perhaps the flag should be nil for an uninstalled Emacs.  That
is an easy way to arrange that the global grab will not occur when
debugging.

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

* Re: Keyboard grabs
  2002-04-20 17:27   ` Richard Stallman
@ 2002-04-22 18:41     ` Jan D.
  2002-04-23 19:30       ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Jan D. @ 2002-04-22 18:41 UTC (permalink / raw)
  Cc: emacs-devel

> But there should be a flag which controls whether to do the global
> grab.  Perhaps the flag should be nil for an uninstalled Emacs.  That
> is an easy way to arrange that the global grab will not occur when
> debugging.

I've installed keyboard grab.  I've used a C-variable x_menu_grab_keyboard
which one can set to zero to prevent the keyboard grab from the debugger.
I didn't get fancy with the install suggestion, after all, the grab only
causes problem if you suspend or stop Emacs while a menu is posted.  Surely
one can start Emacs from within the debugger in that case?

	Jan D.

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

* Re: Keyboard grabs
  2002-04-22 18:41     ` Jan D.
@ 2002-04-23 19:30       ` Richard Stallman
  2002-04-23 20:01         ` Jan D.
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2002-04-23 19:30 UTC (permalink / raw)
  Cc: emacs-devel

    I didn't get fancy with the install suggestion, after all, the grab only
    causes problem if you suspend or stop Emacs while a menu is posted.  Surely
    one can start Emacs from within the debugger in that case?

Assume you did start Emacs from the debugger--if it hits a breakpoint
while a menu is posted, how do you type anything at the debugger?
Your console is hosed!  I've seen things like this happen with grabs
in Emacs before.

So I think it is important to have something that will help prevent
this problem case.  Testing for an uninstalled Emacs was the idea I
had.  Do you have another idea for a default criterion?

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

* Re: Keyboard grabs
  2002-04-23 19:30       ` Richard Stallman
@ 2002-04-23 20:01         ` Jan D.
  2002-04-25  6:05           ` Richard Stallman
  0 siblings, 1 reply; 9+ messages in thread
From: Jan D. @ 2002-04-23 20:01 UTC (permalink / raw)
  Cc: emacs-devel

> 
>     I didn't get fancy with the install suggestion, after all, the grab only
>     causes problem if you suspend or stop Emacs while a menu is posted.  Surely
>     one can start Emacs from within the debugger in that case?
> 
> Assume you did start Emacs from the debugger--if it hits a breakpoint
> while a menu is posted, how do you type anything at the debugger?
> Your console is hosed!  I've seen things like this happen with grabs
> in Emacs before.
> 
> So I think it is important to have something that will help prevent
> this problem case.  Testing for an uninstalled Emacs was the idea I
> had.  Do you have another idea for a default criterion?
> 

I kind of assumed that if you are debugging and suspect you might end up
in this situation, you set the variable in the debugger before starting
Emacs.  If you forget this, you are hosed of course, so a default off
for uninstalled is a good idea.

What is the proper way to check for installed/uninstalled Emacs?

	Jan D.

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

* Re: Keyboard grabs
  2002-04-23 20:01         ` Jan D.
@ 2002-04-25  6:05           ` Richard Stallman
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Stallman @ 2002-04-25  6:05 UTC (permalink / raw)
  Cc: emacs-devel

    I kind of assumed that if you are debugging and suspect you might end up
    in this situation, you set the variable in the debugger before starting
    Emacs.  If you forget this, you are hosed of course, so a default off
    for uninstalled is a good idea.

    What is the proper way to check for installed/uninstalled Emacs?

Look at the value of installation-directory.  It is nil
for an installed Emacs.

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

end of thread, other threads:[~2002-04-25  6:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-03  4:56 Keyboard grabs Richard Stallman
2002-04-19 20:24 ` Jan D.
2002-04-19 21:03   ` Pavel Janík
2002-04-20  9:48     ` Jan D.
2002-04-20 17:27   ` Richard Stallman
2002-04-22 18:41     ` Jan D.
2002-04-23 19:30       ` Richard Stallman
2002-04-23 20:01         ` Jan D.
2002-04-25  6:05           ` 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).