all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* RE: Problem with `while-no-input'
@ 2006-04-26 12:10 klaus.berndl
  2006-04-26 12:43 ` Lennart Borgman
  2006-04-26 12:52 ` Jason Rumney
  0 siblings, 2 replies; 35+ messages in thread
From: klaus.berndl @ 2006-04-26 12:10 UTC (permalink / raw)
  Cc: emacs-devel

Jason Rumney wrote:
> klaus.berndl@sdm.de wrote:
>> I'm running a build from 22. April 2006 build for Windows
>> (i386-mingw-nt5.1.2600). With this build it runs (i.e. interrupts)
>> via: 
>> - all keys
>> - middle-mouse of a 3 button mouse
>> - mouse-wheel
>> 
>> It interrupts *not* via left and right mouse-buttons...
>> 
> Is the value of w32-num-mouse-buttons 2?

yes.

But i use a 3-button mouse! I didn't know that a user has explicitly
set this variable to 3 if he uses a 3-button mouse?! Is this documented
somewhere??

Anyway: If i set w32-num-mouse-buttons to 3 via setq than all works fine,
means the code is interrupted by every mouse-button...

Without this setting only button 2 interrupts, but not buttons 1 and 3...

> It seems not to interrupt for me if I set w32-num-mouse-buttons
> explicitly to 2 and press the left or right mouse button quickly.
> Probably related to w32-mouse-button-tolerance.
> 
> So there is probably a case missing in the timeout for simulated
> middle button clicks for two button mice.

^ permalink raw reply	[flat|nested] 35+ messages in thread
* RE: Problem with `while-no-input'
@ 2006-04-27  6:41 klaus.berndl
  2006-04-27 21:26 ` Richard Stallman
  0 siblings, 1 reply; 35+ messages in thread
From: klaus.berndl @ 2006-04-27  6:41 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:
>     > I note that you say "now".  Did someone make a fix?
> 
>     If i correctly remember the discussion i tought Jason has applied
> a fix...?! 
> 
> Ok, that is good.  (I don't remember at all.)
> 
> Would anyone like to work on this bug?

seems to be done already... see recent discussion...

> 
>>     But pressing/releasing mouse-buttons does still not interrupt
>>     this code! First after a keypress it is interrupted and then
>>     first the queued mouse-click is performed before the pressed key
>>     is inserted in the buffer (that key which has interrupted this
>> code). 

^ permalink raw reply	[flat|nested] 35+ messages in thread
* RE: Problem with `while-no-input'
@ 2006-04-26 12:58 klaus.berndl
  0 siblings, 0 replies; 35+ messages in thread
From: klaus.berndl @ 2006-04-26 12:58 UTC (permalink / raw)
  Cc: emacs-devel

Thanks for explanation!
 
is not a big deal to set w32-num-mouse... in the emacs-setup...but nevertheless: It would be better if Emacs would detect this for itself ;-)
I can not judge, if Lennarts suggestion in his posting is a good approach because i do not have the needed knowhow - but maybe another guy on this list...?! ;-)
 
Ciao,
klaus

________________________________

From: Jason Rumney [mailto:jasonr@gnu.org] 
Sent: Wednesday, April 26, 2006 2:52 PM
To: Berndl, Klaus
Cc: emacs-devel@gnu.org
Subject: Re: Problem with `while-no-input'


klaus.berndl@sdm.de wrote: 

	Jason Rumney wrote:
	  

		Is the value of w32-num-mouse-buttons 2?
		    

	
	yes.
	
	But i use a 3-button mouse! I didn't know that a user has explicitly
	set this variable to 3 if he uses a 3-button mouse?! Is this documented
	somewhere??
	  


It does no harm to have a 3 button mouse falsely detected as a 2-button mouse, since it only means the hack of pressing left and right buttons simultaneously to simulate a middle click is enabled when it does not need to be. Most likely your mouse drivers do not support querying the mouse for its capabilities so it is defaulting to the least common denominator case.

^ permalink raw reply	[flat|nested] 35+ messages in thread
* RE: Problem with `while-no-input'
@ 2006-04-26 11:46 klaus.berndl
  2006-04-26 11:59 ` Jason Rumney
  0 siblings, 1 reply; 35+ messages in thread
From: klaus.berndl @ 2006-04-26 11:46 UTC (permalink / raw)
  Cc: emacs-devel

Jason Rumney wrote:
> klaus.berndl@sdm.de wrote:
>> But pressing/releasing mouse-buttons does still not interrupt this
>> code! First after a keypress it is interrupted and then first the
>> queued mouse-click is performed before the pressed key is inserted
>> in the buffer (that key which has interrupted this code).
>> 
>> Is this behavior intended? If yes, why? Would it not better also
>> enabling mouse-interruption? 
>> 
> No, it is not intended. I added the interruption code to mouse button
> and wheel events as well as keyboard input, and in this works for me
> with emacs -Q.

I'm running a build from 22. April 2006 build for Windows (i386-mingw-nt5.1.2600).
With this build it runs (i.e. interrupts) via:
- all keys
- middle-mouse of a 3 button mouse 
- mouse-wheel

It interrupts *not* via left and right mouse-buttons...

> (defun klaus-test-input ()
>   (interactive)
>   (let ((result nil)
>         (i 0))
>     (setq result (while-no-input
>                    (while t
>                      (setq i (1+ i)))))
>     (message "Klaus: %s" result)))

Ciao,
Klaus

^ permalink raw reply	[flat|nested] 35+ messages in thread
* RE: Problem with `while-no-input'
@ 2006-04-26  9:42 klaus.berndl
  2006-04-26 18:53 ` Richard Stallman
  0 siblings, 1 reply; 35+ messages in thread
From: klaus.berndl @ 2006-04-26  9:42 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:
>     Now this code is also interrupted by any keypress (not only after
>     C-g as in a previous build) - Fine!
> 
> I note that you say "now".  Did someone make a fix?

If i correctly remember the discussion i tought Jason has applied a fix...?!

> 
>     But pressing/releasing mouse-buttons does still not interrupt this
>     code! First after a keypress it is interrupted and then first the
>     queued mouse-click is performed before the pressed key is
>     inserted in the buffer (that key which has interrupted this code).
> 
> I think that too is a bug which ought to be fixed.

^ permalink raw reply	[flat|nested] 35+ messages in thread
* RE: Problem with `while-no-input'
@ 2006-04-25  9:35 klaus.berndl
  2006-04-25 22:05 ` Richard Stallman
  2006-04-26 11:19 ` Jason Rumney
  0 siblings, 2 replies; 35+ messages in thread
From: klaus.berndl @ 2006-04-25  9:35 UTC (permalink / raw)


after running a current build of CVS-Emacs with Windows NT and
testing the short test-snippet below with this current build i got
new results:

Now this code is also interrupted by any keypress (not only after C-g
as in a previous build) - Fine!

But pressing/releasing mouse-buttons does still not interrupt this
code! First after a keypress it is interrupted and then first the queued
mouse-click is performed before the pressed key is inserted in the buffer
(that key which has interrupted this code).

Is this behavior intended? If yes, why? Would it not better also
enabling mouse-interruption?

But nevertheless many thanks for your efforts to make it interruptable by key!

Ciao,
Klaus

> I tried this short test-code:
> 
> (defun klaus-test-input ()
>   (interactive)
>   (let ((result nil)
>         (i 0))
>     (setq result (while-no-input
>                    (while t
>                      (setq i (1+ i)))))
>     (message "Klaus: %s" result)))
> 
> I expected this to being interrupted by any user-interaction (e.g.
> keypress etc..) and setting result to t according to the docstring of
> `while-no-input': 
> 
>    while-no-input is a Lisp macro in `subr.el'.
>    (while-no-input &rest body)
> 
>    Execute body only as long as there's no pending input.
>    If input arrives, that ends the execution of body,
>    and `while-no-input' returns t.  Quitting makes it return nil.
>    If body finishes, `while-no-input' returns whatever value body
> produced. 
> 
> But only C-g interrupts this code but not pressing any key like 'a'
> etc... 
> 
> Have i overlooked something or have i misunderstood the documentation
> of `while-no-input'? Have i misinterpreted the sentence "If input
> arrives, 
> that ends the execution of body, and `while-no-input' returns t" or
> what 
> I'm doing wrong?
> 
> Thanks for your help!
> 
> I tried this with Emacs 22.0.50.1 compiled on 29.1.2006 for
> Windows.... 
> 
> Ciao,
> Klaus
> 
> 
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 35+ messages in thread
* RE: Problem with `while-no-input'
@ 2006-03-10  7:38 klaus.berndl
  2006-03-11  0:08 ` Richard Stallman
  0 siblings, 1 reply; 35+ messages in thread
From: klaus.berndl @ 2006-03-10  7:38 UTC (permalink / raw)
  Cc: emacs-devel

Richard Stallman wrote:
>     Maybe windoze doesn't have some form of async input processing,
> so maybe it cannot see if input arrives while it is running lisp
> code.  
> 
> If that is so, we should document the deficiency somehow.

Hmm, would it not better, to enable while-not-input also working with Windows? ;-)
(no, i have not the know-how to do this for myself, sorry - and it`s also only a plea from me if a developer with the needed knowhow could do it - i thought, some mails from Jason and lennard points to the right entry?!...)

IMHO this is a very important and helpful macro which enables Emacs and other nifty tools on top of Emacs to be much more user-friendly and -responsive! And IMHO a lot of windows-users want to use Emacs.......

Klaus

^ permalink raw reply	[flat|nested] 35+ messages in thread
* RE: Problem with `while-no-input'
@ 2006-03-08 14:50 klaus.berndl
  0 siblings, 0 replies; 35+ messages in thread
From: klaus.berndl @ 2006-03-08 14:50 UTC (permalink / raw)
  Cc: emacs-devel

Kim F. Storm wrote:
> <klaus.berndl@sdm.de> writes:
> 
>> I tried this with Emacs 22.0.50.1 compiled on 29.1.2006 for
>> Windows.... 
> 
> It works fine on
> 
> GNU Emacs 22.0.50.69 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll
> bars) of 2006-03-08 on kfs-l.imdomain.dk 
> 
> Maybe windoze doesn't have some form of async input processing, so
> maybe it cannot see if input arrives while it is running lisp code. 

Well - could be, do not know - but is the `while-no-input' not intended
to work on each os supported by Emacs? AFAIK Emacs supports Windows...;-)

I assume not while-no-input but the underlying `throw-on-input' mechanism
at c-level is the root of the problem, isn't it?

klaus

^ permalink raw reply	[flat|nested] 35+ messages in thread
* Re: Problem with `while-no-input'
@ 2006-03-08 13:05 LENNART BORGMAN
  2006-03-08 13:50 ` martin rudalics
                   ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: LENNART BORGMAN @ 2006-03-08 13:05 UTC (permalink / raw)
  Cc: emacs-devel, klaus.berndl

From: storm@cua.dk (Kim F. Storm)

> <klaus.berndl@sdm.de> writes:
> 
> > I tried this with Emacs 22.0.50.1 compiled on 29.1.2006 for 
> Windows....
> It works fine on 
> 
> GNU Emacs 22.0.50.69 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll 
> bars) of 2006-03-08 on kfs-l.imdomain.dk
> 
> Maybe windoze doesn't have some form of async input processing, so 
> maybe it cannot see if input arrives while it is running lisp code.

MS Windows is event driven. Maybe some input queue must be checked?

^ permalink raw reply	[flat|nested] 35+ messages in thread
* Problem with `while-no-input'
@ 2006-03-08 11:34 klaus.berndl
  2006-03-08 12:41 ` Kim F. Storm
  0 siblings, 1 reply; 35+ messages in thread
From: klaus.berndl @ 2006-03-08 11:34 UTC (permalink / raw)


Hello,

A question to `while-no-input':

I tried this short test-code:

(defun klaus-test-input ()
  (interactive)
  (let ((result nil)
        (i 0))
    (setq result (while-no-input
                   (while t
                     (setq i (1+ i)))))
    (message "Klaus: %s" result)))

I expected this to being interrupted by any user-interaction (e.g. keypress etc..)
and setting result to t according to the docstring of `while-no-input':

   while-no-input is a Lisp macro in `subr.el'.
   (while-no-input &rest body)

   Execute body only as long as there's no pending input.
   If input arrives, that ends the execution of body,
   and `while-no-input' returns t.  Quitting makes it return nil.
   If body finishes, `while-no-input' returns whatever value body produced.

But only C-g interrupts this code but not pressing any key like 'a' etc...

Have i overlooked something or have i misunderstood the documentation of
`while-no-input'? Have i misinterpreted the sentence "If input arrives,
that ends the execution of body, and `while-no-input' returns t" or what
I'm doing wrong?

Thanks for your help!

I tried this with Emacs 22.0.50.1 compiled on 29.1.2006 for Windows....

Ciao,
Klaus

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

end of thread, other threads:[~2006-04-27 21:26 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-26 12:10 Problem with `while-no-input' klaus.berndl
2006-04-26 12:43 ` Lennart Borgman
2006-04-26 12:58   ` Jason Rumney
2006-04-26 12:52 ` Jason Rumney
  -- strict thread matches above, loose matches on Subject: below --
2006-04-27  6:41 klaus.berndl
2006-04-27 21:26 ` Richard Stallman
2006-04-26 12:58 klaus.berndl
2006-04-26 11:46 klaus.berndl
2006-04-26 11:59 ` Jason Rumney
2006-04-26 18:05   ` Jason Rumney
2006-04-26  9:42 klaus.berndl
2006-04-26 18:53 ` Richard Stallman
2006-04-25  9:35 klaus.berndl
2006-04-25 22:05 ` Richard Stallman
2006-04-26 11:19 ` Jason Rumney
2006-03-10  7:38 klaus.berndl
2006-03-11  0:08 ` Richard Stallman
2006-03-11 12:35   ` Jason Rumney
2006-03-11 15:29     ` Jason Rumney
2006-03-11 21:55       ` Eli Zaretskii
2006-03-11 22:47         ` Jason Rumney
2006-03-12  0:00         ` Jason Rumney
2006-03-11 17:41     ` Eli Zaretskii
2006-03-11 22:45       ` Jason Rumney
2006-03-11 23:46     ` Richard Stallman
2006-03-08 14:50 klaus.berndl
2006-03-08 13:05 LENNART BORGMAN
2006-03-08 13:50 ` martin rudalics
2006-03-08 14:01   ` martin rudalics
2006-03-11 16:37   ` Eli Zaretskii
2006-03-08 14:50 ` Jason Rumney
2006-03-08 15:00 ` Stefan Monnier
2006-03-08 11:34 klaus.berndl
2006-03-08 12:41 ` Kim F. Storm
2006-03-09 17:13   ` Richard Stallman

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.