GNU bug report logs - #675
23.0.60; Edebugging track-mouse

Previous Next

Package: emacs;

Reported by: bojohan+mail <at> dd.chalmers.se (Johan Bockgård)

Date: Fri, 8 Aug 2008 18:05:05 UTC

Severity: minor

Tags: confirmed

Found in versions 24.5, 25.0.95, 24.3

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 675 in the body.
You can then email your comments to 675 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#675; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to bojohan+mail <at> dd.chalmers.se (Johan Bockgård):
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: bojohan+mail <at> dd.chalmers.se (Johan Bockgård)
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.60; Edebugging track-mouse
Date: Fri, 08 Aug 2008 19:55:28 +0200
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.

-- 
Johan Bockgård




Severity set to 'minor' from 'normal' Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 11 Sep 2011 17:25:02 GMT) Full text and rfc822 format available.

Added tag(s) confirmed. Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 11 Sep 2011 17:25:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#675; Package emacs. (Sun, 11 Sep 2011 17:38:13 GMT) Full text and rfc822 format available.

Message #12 received at 675 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: bojohan+mail <at> dd.chalmers.se (Johan Bockgård)
Cc: 675 <at> debbugs.gnu.org
Subject: Re: 23.0.60; Edebugging track-mouse
Date: Sun, 11 Sep 2011 19:17:01 +0200
bojohan+mail <at> 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/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#675; Package emacs. (Wed, 26 Feb 2014 09:17:02 GMT) Full text and rfc822 format available.

Message #15 received at 675 <at> debbugs.gnu.org (full text, mbox):

From: Xue Fuqiao <xfq <at> gnu.org>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: 675 <at> debbugs.gnu.org,
 Johan Bockgård <bojohan+mail <at> dd.chalmers.se>
Subject: Re: bug#675: 23.0.60; Edebugging track-mouse
Date: Wed, 26 Feb 2014 17:16:33 +0800
Lars Magne Ingebrigtsen <larsi <at> 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/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#675; Package emacs. (Sun, 10 Jul 2016 21:05:01 GMT) Full text and rfc822 format available.

Message #18 received at 675 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Xue Fuqiao <xfq <at> gnu.org>
Cc: Lars Magne Ingebrigtsen <larsi <at> gnus.org>, 675 <at> debbugs.gnu.org,
 Johan Bockgård <bojohan+mail <at> dd.chalmers.se>
Subject: Re: bug#675: 23.0.60; Edebugging track-mouse
Date: Sun, 10 Jul 2016 17:04:27 -0400
found 675 24.3
found 675 24.5
found 675 25.0.95
quit

Xue Fuqiao <xfq <at> gnu.org> writes:

> Lars Magne Ingebrigtsen <larsi <at> 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}.




bug Marked as found in versions 24.3. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 10 Jul 2016 21:05:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 24.5. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 10 Jul 2016 21:05:02 GMT) Full text and rfc822 format available.

bug Marked as found in versions 25.0.95. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sun, 10 Jul 2016 21:05:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#675; Package emacs. (Sun, 20 Oct 2019 07:38:02 GMT) Full text and rfc822 format available.

Message #27 received at 675 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: bojohan+mail <at> dd.chalmers.xn--se, 675 <at> debbugs.gnu.org
Subject: Re: bug#675: 23.0.60; Edebugging track-mouse
Date: Sun, 20 Oct 2019 09:36:56 +0200
bojohan+mail <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#675; Package emacs. (Sun, 20 Oct 2019 11:01:02 GMT) Full text and rfc822 format available.

Message #30 received at 675 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bojohan+mail <at> dd.chalmers.xn--se, 675 <at> debbugs.gnu.org
Subject: Re: bug#675: 23.0.60; Edebugging track-mouse
Date: Sun, 20 Oct 2019 14:00:16 +0300
> From: Lars Ingebrigtsen <larsi <at> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#675; Package emacs. (Sun, 20 Oct 2019 11:22:02 GMT) Full text and rfc822 format available.

Message #33 received at 675 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: bojohan+mail <at> dd.chalmers.xn--se, 675 <at> debbugs.gnu.org
Subject: Re: bug#675: 23.0.60; Edebugging track-mouse
Date: Sun, 20 Oct 2019 13:21:08 +0200
Eli Zaretskii <eliz <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#675; Package emacs. (Sun, 20 Oct 2019 11:39:02 GMT) Full text and rfc822 format available.

Message #36 received at 675 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: bojohan+mail <at> dd.chalmers.xn--se, 675 <at> debbugs.gnu.org
Subject: Re: bug#675: 23.0.60; Edebugging track-mouse
Date: Sun, 20 Oct 2019 14:38:40 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: bojohan+mail <at> dd.chalmers.xn--se,  675 <at> debbugs.gnu.org
> Date: Sun, 20 Oct 2019 13:21:08 +0200
> 
> Eli Zaretskii <eliz <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#675; Package emacs. (Sun, 20 Oct 2019 11:50:01 GMT) Full text and rfc822 format available.

Message #39 received at 675 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: bojohan+mail <at> dd.chalmers.xn--se, 675 <at> debbugs.gnu.org
Subject: Re: bug#675: 23.0.60; Edebugging track-mouse
Date: Sun, 20 Oct 2019 13:49:20 +0200
Eli Zaretskii <eliz <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#675; Package emacs. (Sat, 12 Feb 2022 07:42:02 GMT) Full text and rfc822 format available.

Message #42 received at 675 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: 675 <at> debbugs.gnu.org, bojohan+mail <at> dd.chalmers.se
Subject: Re: bug#675: 23.0.60; Edebugging track-mouse
Date: Sat, 12 Feb 2022 08:41:38 +0100
bojohan+mail <at> 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




bug marked as fixed in version 29.1, send any further explanations to 675 <at> debbugs.gnu.org and bojohan+mail <at> dd.chalmers.se (Johan Bockgård) Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 12 Feb 2022 07:42:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 12 Mar 2022 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 123 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.