From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Campbell Barton Newsgroups: gmane.emacs.devel Subject: Re: Support for explicitly resetting the idle timer? Date: Sat, 27 Nov 2021 20:14:44 +1100 Message-ID: References: <1d3c782b-6e79-8deb-e34d-f53b94f2fd9c@gmail.com> <83bl2610wt.fsf@gnu.org> <835yse0y70.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31966"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 27 10:16:07 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqtoU-000878-Ey for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 10:16:06 +0100 Original-Received: from localhost ([::1]:53528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqtoT-0003be-1X for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 04:16:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqtnP-0002oW-46 for emacs-devel@gnu.org; Sat, 27 Nov 2021 04:14:59 -0500 Original-Received: from [2607:f8b0:4864:20::102d] (port=42558 helo=mail-pj1-x102d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqtnN-0006BY-Bq; Sat, 27 Nov 2021 04:14:58 -0500 Original-Received: by mail-pj1-x102d.google.com with SMTP id fv9-20020a17090b0e8900b001a6a5ab1392so9671880pjb.1; Sat, 27 Nov 2021 01:14:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Sxm8Vcr03OQ+6/9kPAg7+GzcF33VGKJ8s8/Z0HzyxN8=; b=et5+y1y6ZGa27B28svDoU+6cZOAgcyDFouTZPYwhThABew7DvaLiMaGlywiWrTORHw yV0OKLE9cYz2m6qxVbsQAU6VdjbKYXIUAZhBAQJu1BOZK44lsaOzY5EmcfT5jrqeQl51 Rp3FQ7E5s2VwpdPWOTjIqNjF3MSJ86KSgSQwPfRvsD91IEYVyNrju1AMNPqOuGJZlnMi CXKnTPrzpLFN/xdYupbw8qhKJ31aVHq7ZVUz3DTW5vwKHoWRdx9oSXK1E9TKjAUKoEZ8 DfkjpAEUF1pZEBGZas3vIQCvsXh3lcdbiXzGTI9kvSwTXl/6lmchRj4AF4tUrs1eKmJ9 AFYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Sxm8Vcr03OQ+6/9kPAg7+GzcF33VGKJ8s8/Z0HzyxN8=; b=zsIn0AikgpNeAjVm6w+1EoVDnlxSIMXKCDCYNnj+17m8TTBAQeo7bXiSpmeYq6WI8q m0/9RFBlmNNfbVQCNJXNzZhFrHZy4bYiPRyX84AuutxR1x6Wxa9UF+9fMGTclxRJ51RX iSvD9VOV5oTtULHZvEqah8IojAl8Mem/ZoqmIq8b50ix7TyLofDWBFxXno7lmibc3gE1 ZB+UG2n3p7NJbaC0MjZphXAnJXm68Rn1m8vutYx8k35KbGPIaInHSbICfcjr1Z5bCeUa kiB1j9NJyZE0aFTRK+mKZw6/Qi2iWNGKkEl3GWLE6rmBkJk4Qoj1ZP02/Tk58UKvvwlP LV4w== X-Gm-Message-State: AOAM530BzYFIdMMMyx/0CuA+TqxjVNW/lvOI9fCY7wMf+stilm2zf8C6 5fQlZGTUR4mH+vv+f9j/aHRSlh1NeZ6Im9FQdmBnfuk+QGw= X-Google-Smtp-Source: ABdhPJyyCJDcCD2jO98Gu7auAWMGxAncGf9yRHY9cKUJkJjr3GplA50YyxDRouO6p8pw1B2KiurkzoY7aKbSnChX7Bw= X-Received: by 2002:a17:90b:4c02:: with SMTP id na2mr22252530pjb.94.1638004495570; Sat, 27 Nov 2021 01:14:55 -0800 (PST) In-Reply-To: <835yse0y70.fsf@gnu.org> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=ideasman42@gmail.com; helo=mail-pj1-x102d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:280309 Archived-At: On Sat, Nov 27, 2021 at 8:01 PM Eli Zaretskii wrote: > > > From: Campbell Barton > > Date: Sat, 27 Nov 2021 19:42:15 +1100 > > Cc: Emacs developers > > > > > The cleanest solution in this case would be to call timer_stop_idle if > > > Emacs is executing a command, no matter how it was invoked. In fact, > > > I'm surprised that we don't stop idle timers when track-mouse invokes > > > commands: it sounds like a bug we should fix. > > > > Not sure if this would solve my case (is there some formal definition > > of what is meant by a command?). > > I'm changing the scroll position using `set-window-vscroll` - so I'm > > not sure if that counts as a command. > > 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. (any solution shouldn't be so specific to my use-case of course, AFAICS it's just a case that is reasonable to support with whatever fix/feature is used). > > As a workaround it may be possible to define a dummy command that does > > nothing but reset the idle timer. > > Btw, what do you mean by "reset" here? timer_stop_idle has a > counterpart, timer_resume_idle. I've probably misunderstood the purpose of this function, I only meant to reset the idle timer (as already happens when a key has been pressed). > Would the resumption work under your proposal, and if so, how? Yes, resuming is would be fine, I considered some alternative solution too, e.g. a `(without-idle-timers ...)` macro - which would be useful in my case - but doesn't seem necessary if the idle timer can be reset either explicitly or automatically in more cases than it is currently being done. -- - Campbell