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: Possible support for buffer local idle timers? Date: Mon, 20 Sep 2021 23:49:28 +1000 Message-ID: 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="40201"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 20 15:51:29 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 1mSJhg-000ABN-Lu for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 15:51:28 +0200 Original-Received: from localhost ([::1]:41718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSJhf-0004Cb-8W for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Sep 2021 09:51:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSJfy-0003ST-Iv for emacs-devel@gnu.org; Mon, 20 Sep 2021 09:49:42 -0400 Original-Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:47010) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSJfw-0005t2-VU for emacs-devel@gnu.org; Mon, 20 Sep 2021 09:49:42 -0400 Original-Received: by mail-pf1-x430.google.com with SMTP id 203so8444883pfy.13 for ; Mon, 20 Sep 2021 06:49:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=VTnH0pr2hBqgO3NPmAyIMfJvDrHfxtHWgmzjrsdeGkE=; b=TDgc9wzG698z0wjR/3PXQQmh+SDFew/63+cDCKskQOuo5E9kbpBAqn9iCkKfiir3Av 71p5cx9uRMzWUw0NMjlUdMLLxMA/FpbMwovT2LEDEF10sQiIXN+CazgdzPees9oPuj4J i2SHAjob9DCVx7tnrfa6nxx71rpbvdPhpF/oSdxW5qnIsBllp+Y3zUdsJL1+pYywr1gO ZSEQ8whRVw4up6YarX53iQc/3myUCOKGJMb9Ihq1eIZdUvEL4Eps/fqBLdlP+UtIVyx2 H+TMl5bP1IUWl4SBa/e9RVKKTQtxcj7eHZXC4IpqvfmD2OTGpoKLIForsrI4e668xV+/ J6Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VTnH0pr2hBqgO3NPmAyIMfJvDrHfxtHWgmzjrsdeGkE=; b=FRss4vYFRBss2Kx9X+mEBHK1GV6xildaMERmA4bCoXezms+DEqIr6ZBatOZ3ixOc7o 2MQK1+5ncKeOuuoIz216WoHgfs6EcGiY+h+VGkF9y/WmgCPZMSiDUki/Vbhe+bbn3lUo gVgaWj6sbRXkUrTW9qsKvMZaUh8h5lTEUld+RzPPLA5TuifjasSi34wj9lWKjko3dFwD U6MQpbl/BwecI2gCqs+xoectywm0BmA642xCot2BB+1h0B6br/AV17rS7fcmZPd24yBc nvm8JOO7bqLTaB3GiGCj5TvezEwkswDLXr5P16Bs1DLrb5GWfoZX1o9UVg9EJ/gt8KXd spmQ== X-Gm-Message-State: AOAM531KtlfNe5L95DCJa296+Tzo64onSQovOg4cTV3/jrFOW14IH/S1 ffVnbG6qxNa881LHz/HtdkXXhAbPAvPjAs4BBJZ1EnbhQkM= X-Google-Smtp-Source: ABdhPJwOwsXbaVU7bkoJcN9ygZf55FX+r8NAjOy0351rpTQtoElHMCUd30knV9AF13qqIQnBAEpEtIP/PMEDqdA96cc= X-Received: by 2002:aa7:96c6:0:b0:43f:6ead:5eda with SMTP id h6-20020aa796c6000000b0043f6ead5edamr25217060pfq.40.1632145779075; Mon, 20 Sep 2021 06:49:39 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=ideasman42@gmail.com; helo=mail-pf1-x430.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:275134 Archived-At: Hi, I was wondering if buffer-local idle timers had been considered. The motivation for this feature is that a buffer-local minor mode may want to perform an action when emacs is idle. Currently the only convenient way to do this is to add a global timer that checks the buffer and it's minor modes. This has the reasonably big down-side that disabling the idle-timer requires checking if any buffer currently uses this minor mode, some packages don't bother and leave it turned on, e.g: [0], so disabling the mode never turns off the idle timer. It seems like elisp-only buffer-local idle-timers could be implemented using something similar to this solution [1], the main difference would be that the global-idle-timers would be shared between users with matching delays. Has this been considered or is there a reason this wouldn't be acceptable as part of Emacs? [0]: https://github.com/nonsequitur/idle-highlight-mode/blob/master/idle-highlight-mode.el [1]: https://emacs.stackexchange.com/a/13275/2418