unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#675: 23.0.60; Edebugging track-mouse
       [not found] <yoijk5er1je7.fsf@remote5.student.chalmers.se>
@ 2011-09-11 17:17 ` Lars Magne Ingebrigtsen
  2014-02-26  9:16   ` Xue Fuqiao
  2019-10-20  7:36 ` Lars Ingebrigtsen
  2022-02-12  7:41 ` Lars Ingebrigtsen
  2 siblings, 1 reply; 9+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-11 17:17 UTC (permalink / raw)
  To: Johan Bockgård; +Cc: 675

bojohan+mail@dd.chalmers.se (Johan Bockgård) writes:

> (defun foo ()
>   (track-mouse (ignore) (ignore)))
>
> Instrument the function with C-u C-M-x.
>
> Move the mouse. (Don't click.)
>
> Call (foo)
>
> Press "g". Edebug stops at each expresson inside track-mouse (repeat
> "g").
>
> Expected results: "g" should continue without stopping (only at
> breakpoints).

I can confirm that this issue still exists in Emacs 24.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/





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

* bug#675: 23.0.60; Edebugging track-mouse
  2011-09-11 17:17 ` bug#675: 23.0.60; Edebugging track-mouse Lars Magne Ingebrigtsen
@ 2014-02-26  9:16   ` Xue Fuqiao
  2016-07-10 21:04     ` npostavs
  0 siblings, 1 reply; 9+ messages in thread
From: Xue Fuqiao @ 2014-02-26  9:16 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: 675, Johan Bockgård

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>> (defun foo ()
>>   (track-mouse (ignore) (ignore)))
>>
>> Instrument the function with C-u C-M-x.
>>
>> Move the mouse. (Don't click.)
>>
>> Call (foo)
>>
>> Press "g". Edebug stops at each expresson inside track-mouse (repeat
>> "g").
>>
>> Expected results: "g" should continue without stopping (only at
>> breakpoints).
>
> I can confirm that this issue still exists in Emacs 24.

I can't reproduce it with Emacs 24.3.50.  `g' continues without stopping.

-- 
http://www.gnu.org/software/emacs/





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

* bug#675: 23.0.60; Edebugging track-mouse
  2014-02-26  9:16   ` Xue Fuqiao
@ 2016-07-10 21:04     ` npostavs
  0 siblings, 0 replies; 9+ messages in thread
From: npostavs @ 2016-07-10 21:04 UTC (permalink / raw)
  To: Xue Fuqiao; +Cc: Lars Magne Ingebrigtsen, 675, Johan Bockgård

found 675 24.3
found 675 24.5
found 675 25.0.95
quit

Xue Fuqiao <xfq@gnu.org> writes:

> Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
>>> (defun foo ()
>>>   (track-mouse (ignore) (ignore)))
>>>
>>> Instrument the function with C-u C-M-x.
>>>
>>> Move the mouse. (Don't click.)
>>>
>>> Call (foo)
>>>
>>> Press "g". Edebug stops at each expresson inside track-mouse (repeat
>>> "g").
>>>
>>> Expected results: "g" should continue without stopping (only at
>>> breakpoints).
>>
>> I can confirm that this issue still exists in Emacs 24.
>
> I can't reproduce it with Emacs 24.3.50.  `g' continues without stopping.

I managed to reproduce with 24.3, 24.4, 24.5, and 25.0.95; though not
with 23.4, 24.1, or 24.2.  What's a bit unclear in the OP, is that I had
to move the mouse while (foo) is being called, i.e., M-: (foo) {while
moving mouse hit RET}.





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

* bug#675: 23.0.60; Edebugging track-mouse
       [not found] <yoijk5er1je7.fsf@remote5.student.chalmers.se>
  2011-09-11 17:17 ` bug#675: 23.0.60; Edebugging track-mouse Lars Magne Ingebrigtsen
@ 2019-10-20  7:36 ` Lars Ingebrigtsen
  2019-10-20 11:00   ` Eli Zaretskii
  2022-02-12  7:41 ` Lars Ingebrigtsen
  2 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-20  7:36 UTC (permalink / raw)
  To: bojohan+mail, 675

bojohan+mail@dd.chalmers.se (Johan "Bockgård)" writes:

> emacs -Q
>
> (defun foo ()
>   (track-mouse (ignore) (ignore)))
>
> Instrument the function with C-u C-M-x.
>
> Move the mouse. (Don't click.)
>
> Call (foo)
>
> Press "g". Edebug stops at each expresson inside track-mouse (repeat
> "g").
>
> Expected results: "g" should continue without stopping (only at
> breakpoints).
>
> If the last mouse action was a click the problem doesn't happen.

The code that's causing this is

            (when (input-pending-p)
	      (setq edebug-stop t)
	      (setq edebug-execution-mode 'step) ; for `edebug-overlay-arrow'
	      (edebug-stop))

because when you're tracking the mouse (and you move it), you'll have
input pending, I think?  Hm...  No, it's not that simple -- just moving
the mouse before calling (foo) also triggers this.

Hm!

This gets stranger and stranger.  Here's a simple test case:  Move the
mouse (don't click it), and then eval this:

(track-mouse (input-pending-p))

I get t.  If the last mouse action is a click, then it evaluates to nil.

Right.  Move the mouse (don't click) and then evaluate:

(track-mouse (when (input-pending-p) (read-event "foo: ")))
=> (mouse-movement (#<window 4824 on *unsent wide reply to Johan "Bockgård*> 892 (863 . 529) 1948101423 nil 892 (57 . 17) nil (398 . 19) (15 . 30)))

So `track-mouse' will give you the previous mouse movement?  OK, that's
fine I guess.

But back to the original problem:  (input-pending-p) is non-nil here,
but it's because of a mouse movement, which edebug doesn't care about.

I guess edebug really cares about unread-command-events here?  So
changing the call to just examine that instead might be the fix?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#675: 23.0.60; Edebugging track-mouse
  2019-10-20  7:36 ` Lars Ingebrigtsen
@ 2019-10-20 11:00   ` Eli Zaretskii
  2019-10-20 11:21     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2019-10-20 11:00 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: bojohan+mail, 675

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sun, 20 Oct 2019 09:36:56 +0200
> 
> But back to the original problem:  (input-pending-p) is non-nil here,
> but it's because of a mouse movement, which edebug doesn't care about.
> 
> I guess edebug really cares about unread-command-events here?  So
> changing the call to just examine that instead might be the fix?

Can Edebug bind while-no-input-ignore-events to something appropriate
to rectify this?





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

* bug#675: 23.0.60; Edebugging track-mouse
  2019-10-20 11:00   ` Eli Zaretskii
@ 2019-10-20 11:21     ` Lars Ingebrigtsen
  2019-10-20 11:38       ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-20 11:21 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bojohan+mail, 675

Eli Zaretskii <eliz@gnu.org> writes:

>> But back to the original problem:  (input-pending-p) is non-nil here,
>> but it's because of a mouse movement, which edebug doesn't care about.
>> 
>> I guess edebug really cares about unread-command-events here?  So
>> changing the call to just examine that instead might be the fix?
>
> Can Edebug bind while-no-input-ignore-events to something appropriate
> to rectify this?

Hm...  I'm completely unfamiliar with that variable.

@defvar while-no-input-ignore-events
This variable allow setting which special events @code{while-no-input}
should ignore.  It is a list of symbols.

Perhaps the manual should mention what kind of symbols?

Anyway, I can't see that edebug calls while-no-input?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#675: 23.0.60; Edebugging track-mouse
  2019-10-20 11:21     ` Lars Ingebrigtsen
@ 2019-10-20 11:38       ` Eli Zaretskii
  2019-10-20 11:49         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2019-10-20 11:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: bojohan+mail, 675

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: bojohan+mail@dd.chalmers.xn--se,  675@debbugs.gnu.org
> Date: Sun, 20 Oct 2019 13:21:08 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> @defvar while-no-input-ignore-events
> This variable allow setting which special events @code{while-no-input}
> should ignore.  It is a list of symbols.
> 
> Perhaps the manual should mention what kind of symbols?

See subr.el.

> Anyway, I can't see that edebug calls while-no-input?

I don't remember the details of the implementation, but if you already
tried that and it didn't help in this case, I guess that cannot solve
the issue.





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

* bug#675: 23.0.60; Edebugging track-mouse
  2019-10-20 11:38       ` Eli Zaretskii
@ 2019-10-20 11:49         ` Lars Ingebrigtsen
  0 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-10-20 11:49 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: bojohan+mail, 675

Eli Zaretskii <eliz@gnu.org> writes:

>> Perhaps the manual should mention what kind of symbols?
>
> See subr.el.

;; Don't throw `throw-on-input' on those events by default.
(setq while-no-input-ignore-events
      '(focus-in focus-out help-echo iconify-frame
        make-frame-visible selection-request buffer-switch))

>> Anyway, I can't see that edebug calls while-no-input?
>
> I don't remember the details of the implementation, but if you already
> tried that and it didn't help in this case, I guess that cannot solve
> the issue.

I didn't know what kind of events to bind the variable to to make it
ignore the mouse movements.

I've now tried (in edebug--recursive-edit) to bind it to

              (while-no-input-ignore-events '(mouse-movement))

but it seems to make no difference.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#675: 23.0.60; Edebugging track-mouse
       [not found] <yoijk5er1je7.fsf@remote5.student.chalmers.se>
  2011-09-11 17:17 ` bug#675: 23.0.60; Edebugging track-mouse Lars Magne Ingebrigtsen
  2019-10-20  7:36 ` Lars Ingebrigtsen
@ 2022-02-12  7:41 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2022-02-12  7:41 UTC (permalink / raw)
  To: 675, bojohan+mail

bojohan+mail@dd.chalmers.se (Johan "Bockgård)" writes:

> (defun foo ()
>   (track-mouse (ignore) (ignore)))
>
> Instrument the function with C-u C-M-x.
>
> Move the mouse. (Don't click.)
>
> Call (foo)
>
> Press "g". Edebug stops at each expresson inside track-mouse (repeat
> "g").

I've now fixed this with a gross hack in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2022-02-12  7:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <yoijk5er1je7.fsf@remote5.student.chalmers.se>
2011-09-11 17:17 ` bug#675: 23.0.60; Edebugging track-mouse Lars Magne Ingebrigtsen
2014-02-26  9:16   ` Xue Fuqiao
2016-07-10 21:04     ` npostavs
2019-10-20  7:36 ` Lars Ingebrigtsen
2019-10-20 11:00   ` Eli Zaretskii
2019-10-20 11:21     ` Lars Ingebrigtsen
2019-10-20 11:38       ` Eli Zaretskii
2019-10-20 11:49         ` Lars Ingebrigtsen
2022-02-12  7:41 ` Lars Ingebrigtsen

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