From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Support for explicitly resetting the idle timer? Date: Sat, 27 Nov 2021 11:01:23 +0200 Message-ID: <835yse0y70.fsf@gnu.org> References: <1d3c782b-6e79-8deb-e34d-f53b94f2fd9c@gmail.com> <83bl2610wt.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8624"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Campbell Barton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 27 10:02:18 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 1mqtb8-000233-9E for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 10:02:18 +0100 Original-Received: from localhost ([::1]:47404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqtb7-0007J0-4F for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Nov 2021 04:02:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqta9-0006XF-VG for emacs-devel@gnu.org; Sat, 27 Nov 2021 04:01:17 -0500 Original-Received: from [2001:470:142:3::e] (port=48350 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqta9-0004R4-IO; Sat, 27 Nov 2021 04:01:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nzifcpABO5wLQSvOMLwzQGixCnFAZzgSr2DkJAbyMg0=; b=SDR5/i+7Vlfo Wmuj1MYf1U5heXoISZTXCnEZA5YrDeRW91UYPk4bLx52r0CAPoCam+yFaXEoTtLXLvkDYO+j+rgul uIa3bNy4Muct4kd36giWeIdjEAffBjkXJACF5V0XrgfA7ie6EW+NACBvSpFe0mToMW/Efju3IBSzY Gez9gZociwbuymsqKipwxzjIPOpt7Vo/aCoVIpKj92tAziyB7TFui8E/Fcd6pKB5B3QduKchoAPJy SF5NPIHHfvLxQkjdIbr9Ny9mqJRKsHNyuRaCehnYy72qhPH55xhSCmSRbocsbPNrsoRc20hloK11w dTJoejli6zrmSqdMgvuK+A==; Original-Received: from [87.69.77.57] (port=2122 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqta9-0000Mn-6i; Sat, 27 Nov 2021 04:01:17 -0500 In-Reply-To: (message from Campbell Barton on Sat, 27 Nov 2021 19:42:15 +1100) 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:280308 Archived-At: > 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? > 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. Would the resumption work under your proposal, and if so, how?