From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#51094: Check if run-with{-idle, }-timer needs to create a timer Date: Fri, 08 Oct 2021 12:29:05 +0100 Message-ID: <875yu7lpq6.fsf@tcd.ie> References: <87a6jj97u1.fsf@posteo.net> <87a6jjn6af.fsf@tcd.ie> <87k0in7p8p.fsf@posteo.net> Reply-To: "Basil L. Contovounesios" Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11682"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) 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:30:41 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 1mYo5I-0002oo-7h for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Oct 2021 13:30:40 +0200 Original-Received: from localhost ([::1]:37574 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYo5H-0007Ld-2n for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Oct 2021 07:30:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYo4g-0007LS-82 for bug-gnu-emacs@gnu.org; Fri, 08 Oct 2021 07:30:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYo4f-0002ss-Vn for bug-gnu-emacs@gnu.org; Fri, 08 Oct 2021 07:30:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mYo4f-00075A-S5 for bug-gnu-emacs@gnu.org; Fri, 08 Oct 2021 07:30:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Oct 2021 11:30:01 +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.163369255527143 (code B ref 51094); Fri, 08 Oct 2021 11:30:01 +0000 Original-Received: (at 51094) by debbugs.gnu.org; 8 Oct 2021 11:29:15 +0000 Original-Received: from localhost ([127.0.0.1]:49386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYo3v-00073j-5B for submit@debbugs.gnu.org; Fri, 08 Oct 2021 07:29:15 -0400 Original-Received: from mail-wr1-f43.google.com ([209.85.221.43]:40665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mYo3t-00073U-8b for 51094@debbugs.gnu.org; Fri, 08 Oct 2021 07:29:14 -0400 Original-Received: by mail-wr1-f43.google.com with SMTP id i12so16182177wrb.7 for <51094@debbugs.gnu.org>; Fri, 08 Oct 2021 04:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd.ie; s=google21; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=H18wFBVnd7y7sMOBudFRTd+Q8EQKVrA7wlYC7BDcR4M=; b=dcHMPA0tNyqeu1YGpNvYa72JHLMxqDswrqLXSwwO2SEX4wt3/CVmlEqIRTXub5j1li uHBc2KaHN30Zb6KAb5/7tDsjyUH5c/tVoGFO7JmhvXKlCdn7p8q/kMNQwsyLVVDC3WGi uun625GQvzOhkuYcbIZ+NPHhzefI8wK9tjjzHvZywP5fDpl3bvIZpPcygmAzEvYV1mrk 4CM1Ds2jmlO/OIUS7/fkU90NPSKVY+hTBE0pIdUTkpRvrCa7s3Oc1y1xqhWIhvm06+RW beIfGtj0TPBcRNbaYN0qAHuPi37FU3/0ZUX34TlPXoMDTSZ7FHX7/Z+DhcrLdWSAs14I yvVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=H18wFBVnd7y7sMOBudFRTd+Q8EQKVrA7wlYC7BDcR4M=; b=nmDb1DRZhUkLzk+ULbJyU/EM83JozPBBIQKeGFkcfrkVd/l1bfkK8jERPG3Gkqk3IM 6aF6SWrUDWMvxqASlNBuBFzLUDF5Vly9C5Vp/p7ga0xDtiqB0vfIhjAlvB+xMKG7PlQh 10OnDmuBPVyxhmaBg1PamQ5J9VyKEYqMiPkTjbuG0Jol+S56nnL51BG7yMlq2TpBeUZa BUjTuh5WctC1qIf4KdzQhtcnY0lxN3ue0ODn3Wnw+Dovo6kjEbbERu4mWpKMRKdQifDw J2bEY3UQnVnOfUVmmOed/l2Ng8zhBvgvtba516EXlihtEJ/W7SWf34uWTPDzLNzRKqS7 lHLg== X-Gm-Message-State: AOAM530X1nxOikUj9QMRlL8RquRHi6weLhUH/te9bNW7njyhhOX6qndd 91gWCahi5c2fqrZ1O9bD0BPa/g== X-Google-Smtp-Source: ABdhPJw75NScnglKyD+MOytLI5mDqn70IuIlq7nikJyptXwUHNKtm7XwYCd8Cs2mwDbO807KD98XXQ== X-Received: by 2002:a1c:2b85:: with SMTP id r127mr1784700wmr.134.1633692547330; Fri, 08 Oct 2021 04:29:07 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:f410:82e8:3a21:eedf]) by smtp.gmail.com with ESMTPSA id p11sm9404512wmi.0.2021.10.08.04.29.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 04:29:06 -0700 (PDT) In-Reply-To: <87k0in7p8p.fsf@posteo.net> (Philip Kaludercic's message of "Fri, 08 Oct 2021 11:03:18 +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:216711 Archived-At: Philip Kaludercic [2021-10-08 11:03 +0000] wrote: > "Basil L. Contovounesios" writes: >> Philip Kaludercic [2021-10-08 09:36 +0000] wrote: >> >>> 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. >> >> IIUC, the semantics of SECS=0 (alias nil) is not the same as eager >> funcall, because timer functions are intended to be run asynchronously >> in a separate command loop. So often what is meant by "now" is e.g. "as >> soon as I quit the current active minibuffer". > > I see, it might be necessary to consider examples where this might go > wrong. Off the top of my head there's also ivy-quit-and-run in the ivy package, but Lars pointed to effectively the same idiom. >> I realise this patch does not touch run-at-time, but it's documented as >> being interchangeable with run-with-timer, so the eager funcall sounds >> like a breaking change. >> >> If packages indeed want to run something immediately, why create a timer >> at all? Or am I misunderstanding something? > > Because you might want to delay certain things, such as highlighting or > completion. What I meant is, the choice whether to run-with-timer or funcall can be left to the calling package, since it knows better what it wants to do. Thanks, -- Basil