From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#35400: 27.0.50; Timers repeated after waking from suspend Date: Wed, 03 Feb 2021 19:42:29 +0100 Message-ID: <87tuqtgfhm.fsf@gnus.org> References: <834l6o4ok4.fsf@gnu.org> <87y2g6lesc.fsf@gnus.org> <83ft2e5vu1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6361"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 35400@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 03 19:43:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1l7N7T-0001X7-5l for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 19:43:15 +0100 Original-Received: from localhost ([::1]:40526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7N7S-0000Ih-86 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Feb 2021 13:43:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7N7H-0000IV-2m for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 13:43:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7N7G-0001pW-Ke for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 13:43:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l7N7G-000124-IA for bug-gnu-emacs@gnu.org; Wed, 03 Feb 2021 13:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Feb 2021 18:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35400 X-GNU-PR-Package: emacs Original-Received: via spool by 35400-submit@debbugs.gnu.org id=B35400.16123777653943 (code B ref 35400); Wed, 03 Feb 2021 18:43:02 +0000 Original-Received: (at 35400) by debbugs.gnu.org; 3 Feb 2021 18:42:45 +0000 Original-Received: from localhost ([127.0.0.1]:38861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7N6z-00011X-8q for submit@debbugs.gnu.org; Wed, 03 Feb 2021 13:42:45 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:48036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7N6x-00011K-Gz for 35400@debbugs.gnu.org; Wed, 03 Feb 2021 13:42:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Tc81IQR0MgJcdjYszETQ3ogwHosbM2VHoE2USzyNSrI=; b=eG8MtNKHOI46V+yKzQ9hZtEKXq p+E6SRFAKoffQjMce3QZpAda+WnBwPkmt6kREJD7N4w1wBG7a04kz7YG+oYP1UihM9uv+99ezzBS+ rGhGPINZTz/6CGicoUdn3kroURsJq7UMwlvsi4H1HbQBYrZ/rJVfl+sj2CvuoGHw6d18=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l7N6l-0004cS-0N; Wed, 03 Feb 2021 19:42:36 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEUUCgpbPCihhFrp 25v///9c8SoiAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UCAxIJACxIEEgAAAGESURBVDjLzZPRmcQg CIRxKxDSwIoVRPrv7QYEk7sKzof9Nv4OyCBEWMxDVMzUltJrfZjx21gN6/vstzVcRc2Raj/gsjGo dUj6R1XHEZhdqgvg+l4rjpTA5gZtCDOXpFmshX+dPyyDeUs+vn1ZKnBzSSB+/Frm4sG9U287VMQx VxA22RUPwPKKe5TZMlQCcdBkKGtmj+Nb4cdVq0ZUcYuttQPDGGTRVLixAQShEGb7pTNChVrgDWyc YXEmD8CoZ6L0yG7HEg9f2r9Ahv9lKgXSWIQSvx/SZI5oKXkHGffrNO12sFDRqhwykWLfCg6oXzIe C2rrxBZ1xBdWKlA6epUAZLsA2/dGgW1PNsg/6QCW7gb2iLdBEYAej6uAt6wA17EA9IAMJNtRphfw C2dr+eRoCdrO3ereBZQPGJnNQZtWgxCODC6gZ0Li8fIG3Xt4P/NhQ4bXFjmeYbvWDNtRakd3S0De mJjJ7YE8M+hZ7mPOa9+D5UMfv/f3ADh4T/lr3qGg/7F+ANSeRC6Wl5FSAAAAJXRFWHRkYXRlOmNy ZWF0ZQAyMDIxLTAyLTAzVDE4OjA5OjAwKzAwOjAwfdGp4AAAACV0RVh0ZGF0ZTptb2RpZnkAMjAy MS0wMi0wM1QxODowOTowMCswMDowMAyMEVwAAAAASUVORK5CYII= X-Now-Playing: Kate Bush's _The Red Shoes_: "Constellation of the Heart" In-Reply-To: (Stefan Monnier's message of "Tue, 02 Feb 2021 11:18:01 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:199229 Archived-At: Stefan Monnier writes: >> So maybe this should be a property of the timer itself? Yeah, that sounds like a good idea. > I think for the case where we missed some timer repetitions, the best > thing we can do is not to call that timer repeatedly but instead to call > it once and pass it the number of times it has fired since the last time > we ran it (so it can then freely decide to repeat its operation N times > or not). > > A related issue is that for many timers, rather than "repeat every > N seconds" we'd rather want "wait N seconds between invocations" (so if > the execution of the timer terminates M seconds after the time T it was > supposed to start running, the next execution should not be scheduled > for T+N but T+M+N). That's true. I think the current way code deals with this is to ask Emacs to repeat once, and then the function itself computes the next delay, and then runs `run-at-time' itself (see for instance `image-animate-timeout'). Having `run-at-time' compute this would be an improvement -- not at least because it would be one single timer function, and you could inspect it from `list-timers', which you can't really do today in this scenario (because it's a new timer on every update). -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no