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.bugs Subject: bug#51094: Check if run-with{-idle, }-timer needs to create a timer Date: Fri, 08 Oct 2021 14:08:03 +0300 Message-ID: <834k9rzsdo.fsf@gnu.org> References: <87a6jj97u1.fsf@posteo.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28568"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51094@debbugs.gnu.org To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 08 13:09:42 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 1mYnkz-00078n-T7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Oct 2021 13:09:41 +0200 Original-Received: from localhost ([::1]:52948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYnky-0005Rf-Iu for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Oct 2021 07:09:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYnkN-0005Dr-EM for bug-gnu-emacs@gnu.org; Fri, 08 Oct 2021 07:09:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYnkM-0002As-Gq for bug-gnu-emacs@gnu.org; Fri, 08 Oct 2021 07:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mYnkM-0006Ve-Bx for bug-gnu-emacs@gnu.org; Fri, 08 Oct 2021 07:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Oct 2021 11:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51094 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51094-submit@debbugs.gnu.org id=B51094.163369132124996 (code B ref 51094); Fri, 08 Oct 2021 11:09:02 +0000 Original-Received: (at 51094) by debbugs.gnu.org; 8 Oct 2021 11:08:41 +0000 Original-Received: from localhost ([127.0.0.1]:49329 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYnk1-0006V5-96 for submit@debbugs.gnu.org; Fri, 08 Oct 2021 07:08:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYnk0-0006Ut-91 for 51094@debbugs.gnu.org; Fri, 08 Oct 2021 07:08:40 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:52902) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYnju-0001j9-8v; Fri, 08 Oct 2021 07:08:34 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2743 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 1mYnjh-0002Te-A3; Fri, 08 Oct 2021 07:08:32 -0400 In-Reply-To: <87a6jj97u1.fsf@posteo.net> (message from Philip Kaludercic on Fri, 08 Oct 2021 09:36:22 +0000) 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:216707 Archived-At: > From: Philip Kaludercic > Date: Fri, 08 Oct 2021 09:36:22 +0000 > > I have seen a few packages use run-with-timer or run-with-idle-timer, > where the SECS parameter is configurable with a user option. When this > timer doesn't repeat itself and it makes sense to set SECS to 0 when you > want something to run immediately, I don't think it makes sense to > create a timer object. > > The following patch would remove this overhead, and calls the function > immediately if it makes sense. I'm not sure we should care, but in any case, what you do there requires a comment explaining the rationale. Thanks.