From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.bugs Subject: bug#52235: 29.0.50; Suggestion: refactor time.el into a more general 'clock' framework Date: Fri, 03 Dec 2021 00:36:37 +0100 Message-ID: References: <87r1avmmtj.fsf@gnus.org> <87wnkn5o1j.fsf@gnus.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="29735"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 52235@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 03 00:37:15 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 1msvdZ-0007UN-FD for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Dec 2021 00:37:13 +0100 Original-Received: from localhost ([::1]:33316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msvdX-0006eO-IY for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Dec 2021 18:37:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msvdP-0006dk-7C for bug-gnu-emacs@gnu.org; Thu, 02 Dec 2021 18:37:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msvdO-0006uJ-V6 for bug-gnu-emacs@gnu.org; Thu, 02 Dec 2021 18:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1msvdO-0001QE-Fl for bug-gnu-emacs@gnu.org; Thu, 02 Dec 2021 18:37:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Arthur Miller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Dec 2021 23:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52235 X-GNU-PR-Package: emacs Original-Received: via spool by 52235-submit@debbugs.gnu.org id=B52235.16384882115448 (code B ref 52235); Thu, 02 Dec 2021 23:37:02 +0000 Original-Received: (at 52235) by debbugs.gnu.org; 2 Dec 2021 23:36:51 +0000 Original-Received: from localhost ([127.0.0.1]:49633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msvdD-0001Po-A7 for submit@debbugs.gnu.org; Thu, 02 Dec 2021 18:36:51 -0500 Original-Received: from mail-oln040092069105.outbound.protection.outlook.com ([40.92.69.105]:60493 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msvdA-0001PT-1z for 52235@debbugs.gnu.org; Thu, 02 Dec 2021 18:36:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MJkmvg+JxCRkDTCzQQELDm+LctF95V1O94qHI50duWaW1jAkrwWNVQe0I8QV9ASmfkUHrbcKxUSU+n/utAcNg7SjMvcUdDF3fYRqOmanaWVNtrS6ZiRIxgjcd5dBbmjDN+FcrfX90wSyHtdRW+DE7CRWrNxOB64dr3yTZ0rBcHag0nXXscJqSuoyzA+TPxgCFIvYiFN26DfGUPQHzYnFFo4sdySZ0R6PzAKnEZiIS+yP7ydxtQ8ZAk7o9qTtGWN/Faazh71xqwbIONepoEdPZ4d0cobz+lnSXPusj4F1Bq+V8LdYlJj/qZqoWA5bvuPF60hM9zNBieX1D18pIGqGJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NNqgTJ8CoitB8M1segFmUs0SbXbExFjgD0URfYeAryY=; b=C5hsi/agCltxes6T4CTUCEBgZ0jtHRwzZVdiMtSL8p1XCWRq98Jl09laDE1YJfWoPzuIqAUpcic6bAz/S6BzaT2U4ShGPrBqAD9Ni4tFqM5qd8gzuoVweIo53EphBvI/ckWx47BuQm+kHOqzkbxw2aYfNdOjFkiNncmF8u7NKVETOOQSD6GAo2XWvE4RXfmIbGung5GTCCHc3jHDFXVjroQrXEmaPZE9sDV3XZtGRSeG/zK12I+LI+cyWUyLmJ113E988ym7zDCfaKQGSpr9dxVW2SfL0cgtgERw3+na8oEee0I02icn1HSZuh4whdJLlEYkYiZc3cVFBMZmA5Qvig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NNqgTJ8CoitB8M1segFmUs0SbXbExFjgD0URfYeAryY=; b=c/pCXGhVyh4smCkk44Xlg7gzI6MoLE6IyLnJ2jgTm8izax9fd37JSRAmvVnChV4pja5aAUKmk+kEj4efEBv83MQLeMscankeieXpxutz/NIQ9ZrlzVg8XT3hhpfsF1udnF3geP34T860FSy+5sQ0vj9dzSOBadoz7Z/Dh24deRKPOq2YJ3mH6cQynOf372pgCOhpwOvwBWVFZ9KLmdoDL3NCQU4fb5su8FoPhNFAFI8zlwLR2rBDtsm9yWlKoVJHwcm/oicvGzo5QBc4B8gH4yYdJX31vS1bcm1cmr1GW+wqoGo82rrNrUJd7Kt6JCslL9R3I7biSSGW0wxer8ChHQ== Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM0PR09MB2387.eurprd09.prod.outlook.com (2603:10a6:208:e3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Thu, 2 Dec 2021 23:36:39 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::b012:5fd9:9447:d64a]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::b012:5fd9:9447:d64a%4]) with mapi id 15.20.4755.017; Thu, 2 Dec 2021 23:36:39 +0000 In-Reply-To: <87wnkn5o1j.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 02 Dec 2021 10:55:20 +0100") X-TMN: [PDxT5OWJMUu6k8vtQOwJvmpU5lBHRJ1F] X-ClientProxiedBy: GV3P280CA0033.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:9::26) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87k0gmtw8q.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by GV3P280CA0033.SWEP280.PROD.OUTLOOK.COM (2603:10a6:150:9::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.17 via Frontend Transport; Thu, 2 Dec 2021 23:36:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ddb7a7d3-6e1b-471b-cd85-08d9b5ec9692 X-MS-TrafficTypeDiagnostic: AM0PR09MB2387: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NhjtPbPANzqHqsIIlXoeKO+a89IsHA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HyVniysKeWgf+Xs1nZZBwIL3XMw8FA3AYUMfaowSwdJ23+RtHqqUzw1zuw47glrXrnzb0wfjIMOwKYKyThWDQJu74ib76ld4/IcORdVqf8j/fzIO9xEJhDRdycwT9j5nF2pf5fDgafZTgSz1IDC/HiR0hN2ex6uRsaJlLuWe74+0yaFWNlAiPUHsfmtF7zf7WPqulqd/g6HuXwPURhS9lk+2Ot+owXwT3ABDiUoP1l/8e8sPZA9++w/PixCxyPqnhANylKUIb+TrD9LcseJYKlvu0LUKHjbgul+q8OFUHO4KeJ4B4Ty isax9KbJ44+NQyxthMNMJ0f8w84/YiBy66Rz648mdWz8zOcL8JLzJV8DQE7seaY5EiQ85cTV/JMP2Wzx+DRq38wCZxDYTWWDiJ X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: ddb7a7d3-6e1b-471b-cd85-08d9b5ec9692 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2021 23:36:39.7591 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR09MB2387 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:221357 Archived-At: Lars Ingebrigtsen writes: > Arthur Miller writes: > >>> If I understand correctly, by "clock beat" you mean an integer multiple >>> of some time? >> I am not sure if we speak about same thing; but I mean the clock, synchronized >> with what Emacs shows as time. > > I'm not sure either, because I'm not sure what you mean by > "synchronized". But if you want a timer to run at 11:01:00, 11:02:00, > 11:03:00, then timer.el has support for that (and calls that "integer > multiple"). Ok. I have tried it now; it seems to work :). TBH I didn't realize what "integer multiple of REPEAT" means in this aspect, so I didn't even use 't option, and I also wanted it to start immidiately so I thought I wanted 'nil = meaning now option. I don't know, blame it on my english, but I found that one tricky to understand doc. I don't know if I can suggest better wording myself, but maybe it might help someone else one day, if that last option was reworded somehow. I think people usually use term "wall clcok" in this context, but I am not sure, I am not native english speaker, but I think I have encountered that term in std c++ docs and Java docs. >> Also there is no read to run several timers when one timer could >> be fine to run several hooks as well as saving some code repetition. > > Running several timers is fine. And I don't think there's any code > repetition? Just say > > (run-at-time t 60 (lambda () (message (format-time-string "%H:%M:%S")))) > > or whatever you want. I guess timers are not very expensive resource in a system, no idea actually how memory/cpu costly (or cheaply) they are, but it is just that I have to keep track of it to cancel it when I am done to not leak resource. By now I am also used to "hooks" in Emacs, and Emacs acting as a framework in many cases, so it kind of suits my mental build better to add a function to a hook and get it called than have to setup this manually. Anyway, this was a suggestion and thanks for the clarification about integer multiple in this context :-).