all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Campbell Barton <ideasman42@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Support for explicitly resetting the idle timer?
Date: Sat, 27 Nov 2021 22:16:10 +1100	[thread overview]
Message-ID: <CAEcf3Nyw-S5yv6Fep2NMiM8-AcQk89cNvwFQ9wcWu358yE6ZdQ@mail.gmail.com> (raw)
In-Reply-To: <83v90dzx5w.fsf@gnu.org>

On Sat, Nov 27, 2021 at 9:54 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Campbell Barton <ideasman42@gmail.com>
> > Date: Sat, 27 Nov 2021 21:21:29 +1100
> > Cc: Emacs developers <emacs-devel@gnu.org>
> >
> > > > > Which code invokes set-window-vscroll, and what triggers that code?
> > > >
> > > > There is a while loop that uses  (read-event) inside a `(track-mouse
> > > > ...)` block that changes the scroll location and redraws.
> > >
> > > But that while loop is invoked by some binding of some mouse gesture,
> > > no?  That binding _is_ the "command" I meant.
> >
> > Ah, right. There is an interactive function bound to a key which runs
> > track-mouse ... etc.
>
> So now I wonder how come the idle timers run for you.  Perhaps the
> command you mention activates track-mouse and exits?

It also seems strange to me, but it's not exiting - it runs
track-mouse and calls read-event & redisplay, just double checked -
idle timers are definitely running inside the track-mouse block (which
is within the command).

> > Arguments could be made against this:
> >
> > - This could break existing packages that use long running commands
> > and expect the idle timer to run.
>
> While a command's code runs, idle timers cannot run, because timers
> only run when Emacs is in its idle loop, waiting for some input.
> Emacs only gets to the idle loop after a command exits and there's no
> further input waiting for processing.

It's possible there is something more specific to my package than I
realized (although I'm not sure what as it's basically re-displaying
in a loop).

-- 
- Campbell



  reply	other threads:[~2021-11-27 11:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27  7:54 Support for explicitly resetting the idle timer? Campbell Barton
2021-11-27  8:02 ` Eli Zaretskii
2021-11-27  8:42   ` Campbell Barton
2021-11-27  9:01     ` Eli Zaretskii
2021-11-27  9:14       ` Campbell Barton
2021-11-27 10:11         ` Eli Zaretskii
2021-11-27 10:21           ` Campbell Barton
2021-11-27 10:54             ` Eli Zaretskii
2021-11-27 11:16               ` Campbell Barton [this message]
2021-11-27 11:33                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEcf3Nyw-S5yv6Fep2NMiM8-AcQk89cNvwFQ9wcWu358yE6ZdQ@mail.gmail.com \
    --to=ideasman42@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.