From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.devel Subject: Re: undo-auto--undoable-change infloop Date: Tue, 09 Aug 2022 06:02:12 +0200 Message-ID: <87zgge3vzv.fsf@web.de> References: <87o7xc1qbh.fsf@web.de> <831qu8dqrx.fsf@gnu.org> <87bktbciup.fsf@web.de> <875yjfo105.fsf@web.de> <87fsii0vvp.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9275"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 09 06:03:17 2022 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 1oLGSa-0002Dn-GK for ged-emacs-devel@m.gmane-mx.org; Tue, 09 Aug 2022 06:03:16 +0200 Original-Received: from localhost ([::1]:54954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLGSY-0004k5-Qh for ged-emacs-devel@m.gmane-mx.org; Tue, 09 Aug 2022 00:03:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLGRi-0003vj-N1 for emacs-devel@gnu.org; Tue, 09 Aug 2022 00:02:22 -0400 Original-Received: from mout.web.de ([212.227.15.3]:34169) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLGRh-0002fn-1y; Tue, 09 Aug 2022 00:02:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1660017734; bh=C+bXvde98bPDEbn1M5ZTbo+hgPv7XOul85mDhcBEyPM=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=Y4yAdY54OOay8iq03LZ1V5T83+QYLmTqRGkgdEkezujvscURKhOqHdcc2goJgYYMo LvPQlf/TF54wn9pVd32qLxQ9qzK2S+YI3i/s7eA0C7OgnySzvzlATjIiQe2SGgSdtu XglkRJxbt/QYDL80K0Uz0xBOfeizyTjwW1TZYl9k= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([84.57.248.18]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1N3oyy-1nLUrF453o-00zwLt; Tue, 09 Aug 2022 06:02:14 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 05 Aug 2022 10:42:54 -0400") X-Provags-ID: V03:K1:Hu13L4e12Ew/dfx7wXXEPGOOnUaD5ReoE84A0A3ghUP3oy25CRz 5Mrhn+lIOemNkw9+LtGzEiGLQO2qAeYGhDI7j6Vi7b6bAXevrbhwtPWlpYzpWtmtBwwo0ua 6UXnq7Y8E2WbSpC+dvkeF+Xe53p3xMCrD7mNb7htBAM7zIux2npC+OMFIWK4jLdWd8pdNAP znpeVN1SpeiQh68M3G66g== X-UI-Out-Filterresults: notjunk:1;V03:K0:X55Lrg7c1PE=:H/GYcNBc0Tqwv2Ve497uLz vbkg5SUSAPR1M+nLLwqNW6D+O4gstVSSpMNcnTySJvMf2YdVkc9tKNsKUxxOP/6sWxYWk7UY+ GNSPiF3MBh3zWoA5nzSidC2o4/u1GNI+wp7SNUxVT9+kqNjpD1QkFTxdWPisc/q1loxeZDuqu t4LMKtaPqwcXY4tytAyhRSU4qX7LlbR12gr343q9j8nwRUB5CEdkMnJDgTtLCyhPhJjavyz5R zMq/u/O/M1e2RH9vCu4krEg7kcqGekrlP0I2FFKC18WuPlKbeVsEY2jxVmPFnL7R3+EJZMsZ4 WfbKfugF6yyJ12hg7Z5QvYnQ7DSkRoJNSkOFZijlpSbR7Nn+QUck2msNtTSupNEs9CBfgvTfT i9mT5gkdjiPS0BmEGvXbmieH8u9RlYpo3By0Fb8lv6RLlf8tHdAn/n0l1vzhh/N+rEC6hTxer rSufHXnE1aZvdpEiGrP3ssvY2Z23KQpeA73Qo69qxQCdWSrN1FYIgzI09ZznCF7FgVSqHIME6 WlUkXZWzIJnJQn7B6m2f0Pds17conwiGKu7UrhMX8XilFKf5m8i1qrW8WFDS9PH7pmANF+cvh UD+j8K7fHud9Yj/urtPdOIs5pQtx03edWWMcIBqMAfhpDTafgMI10WTc0HvSj/VLyFbeUtK+4 CVPSZHyqD4xUIXAbypZlO8Su6+244LWC0dC6FzvT7PQnL2rRnE20nnjy5wrXR25+L3RSA3jUQ FtHbpCEYVWVfLMhXmOqH5mrnmMExmMjf54HGOxGb2TJXV7t7vxFEGWhn3l9hCf7aG7ibnnDV Received-SPF: pass client-ip=212.227.15.3; envelope-from=michael_heerdegen@web.de; helo=mout.web.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:293287 Archived-At: Stefan Monnier writes: > I suspect that `timer-activate` was not intended to be used by > end-users, but in any case I added a check that signals an error if > you try to re-add a timer. I now remember why I am using this. The scenario is always the same, I need this in quite a bunch of packages: I want something happening automatically after certain user interaction (e.g. scrolling, editing the minibuffer etc), say, running a certain function F after a delay of DELTA seconds. When the user does something before DELTA seconds have passed, the time should count from full DELTA again - the timer should be postponed. If it's later, the timer should be started anew (unless the "scenario" had been left). In the code, I can't be certain whether the timer had been triggered (at least without consulting "internal" information). In any case the timer still exists as a timerp fulfilling object (it's the value of some variable I use). So I used `timer-set-time' to update the preferred run time and called `timer-activate' to ensure it's in the list (to cover the second case: timer had been run). And, as we had found out, that is wrong when the timer is actually still in the list. Is there a way to achieve what I want without relying on "internal data" (like looking in `timer-list')? Michael.