From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ignacio Casso Newsgroups: gmane.emacs.bugs Subject: bug#54371: 29.0.50; read-char does not reset idle timer in some cases Date: Sun, 13 Mar 2022 18:45:33 +0100 Message-ID: References: <83sfrmkvuy.fsf@gnu.org> <87lexduc8w.fsf@gnus.org> <83pmmpls5g.fsf@gnu.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="36625"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.10; emacs 27.2 Cc: Lars Ingebrigtsen , 54371@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 13 20:17:11 2022 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 1nTTiI-0009JI-KZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Mar 2022 20:17:10 +0100 Original-Received: from localhost ([::1]:59412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTTiH-00089s-9u for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Mar 2022 15:17:09 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41932) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTTiB-00089c-8j for bug-gnu-emacs@gnu.org; Sun, 13 Mar 2022 15:17:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49398) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nTTiA-0002Gw-EV for bug-gnu-emacs@gnu.org; Sun, 13 Mar 2022 15:17:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nTTiA-0001YE-69 for bug-gnu-emacs@gnu.org; Sun, 13 Mar 2022 15:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ignacio Casso Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Mar 2022 19:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54371 X-GNU-PR-Package: emacs Original-Received: via spool by 54371-submit@debbugs.gnu.org id=B54371.16471989895920 (code B ref 54371); Sun, 13 Mar 2022 19:17:02 +0000 Original-Received: (at 54371) by debbugs.gnu.org; 13 Mar 2022 19:16:29 +0000 Original-Received: from localhost ([127.0.0.1]:43295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTThd-0001XP-Bp for submit@debbugs.gnu.org; Sun, 13 Mar 2022 15:16:29 -0400 Original-Received: from mail-db8eur05olkn2044.outbound.protection.outlook.com ([40.92.89.44]:56001 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTThb-0001XD-Lt for 54371@debbugs.gnu.org; Sun, 13 Mar 2022 15:16:28 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=APv4z6LamtcKCKj5OvSKdYOps51hZEColL+nuWEUNQ6Qh6gagxkFujvVPULd7ceuCkeCxDPRu/vMlYuDdjO26xBzAUWki/z+bTU0F11fRKeIYMpbm9+LZoL0/OeRE6lWgm5lOnc08wVboRWxR60T/rfaucR3AvkoXpCWzcdwEdEMIPjMWV6DdLkGH9rMKvqYyeqHujdN01CwiiahEqoTw0EOKrMvHxqzshWvDWb2lU7yW0zqVxlfCJQkK4bRGq72uJRbTBFaWfaiK7BJwsBOsdQ80g6eZoSP9Lg1DDYSGWu9M9ifhE7xT9Ujpy/enLXbaRs2CE/Ajbu9uBH58d9M5A== 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=/WHbl4/jjQwl01ZE5ezCwN13R3LbMFIlLoCozgu90YE=; b=KHWMdeCMVsrWtCVU/iKVTQdihFbj0eh7LOB75l0RvRIDknU/zLrUDL3wh/DXWnrZW6wzrRj618ViyidvOGG5Gligoo3IvEAIv1aide03Ppj6yfuU2bKDm4m+nRvohStFqFm9FjDiMKOnPSurgkZe4R+ORyNcSqMj4XDyB6RlMkfE2EnovtBMj0Ol8zy/KrAOL6oJMU9M9ykfePFIGSRalxejdx2CjmlsiAKMmMPyTwLJH64JjewoohlkTwszyMYqdQaMTHYL43rlofFfQOUzEWIZUtMugF1TK7XdK7aSAG5r3WXUveuD2bOhDL/OibCQel2bWhaiDjANmS7kZi5iBg== 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=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/WHbl4/jjQwl01ZE5ezCwN13R3LbMFIlLoCozgu90YE=; b=tTfNH1YtcpF02K9p8b7itCx2ugDE7dXwNHoLN+tSJrXQlKA4oKvuiazPIS/4lqNDIdXcR+Ezydsge1b6XSNVeMkI/VGrTGmSHrM60HfnxH0Vo0V1xKNx9mubZZipPmfObWSKj+JsRU2By112qEfKFgfPgCKmskIx4qZdZoRzskHPapj39SVPODlfmk6DRTw97ApK2nlisM64qzqfHw8tEJ3qE4+H6dRSyyB5b+rUf+eO53uVD/pJiRdVo9z4oCD2eM5lNdxz+Sq8a1RvudL8UIfH8sHRN2pkxuAjpUwy2AK0wlT94mm78Us6ho/a8w7mYCy4nCFQpuN6Rg4qP1k26g== Original-Received: from PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) by DB7PR06MB5083.eurprd06.prod.outlook.com (2603:10a6:10:6d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.26; Sun, 13 Mar 2022 19:16:21 +0000 Original-Received: from PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::e05a:8d81:8648:b10f]) by PAXPR06MB7760.eurprd06.prod.outlook.com ([fe80::e05a:8d81:8648:b10f%9]) with mapi id 15.20.5061.026; Sun, 13 Mar 2022 19:16:21 +0000 In-reply-to: <83pmmpls5g.fsf@gnu.org> X-TMN: [07utzfURymcnBfbcckOrYX6Z1hkYy4vo] X-ClientProxiedBy: PR3P193CA0015.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:50::20) To PAXPR06MB7760.eurprd06.prod.outlook.com (2603:10a6:102:155::8) X-Microsoft-Original-Message-ID: <87czipfyuv.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cadc468d-d045-4d4a-a4f2-08da0525f4f7 X-MS-TrafficTypeDiagnostic: DB7PR06MB5083:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6dMNKb11hr26VagY8E0PK1WnqAifcD/huYlpMkOHocOiBump18rh6CIQDUtZXNJYomN5GEe5GSjzXlX/iIgSLNGMMmdHsu91qEP0aT0NWmGc10LZKrKM8cTHRYaIcPPptANXuP1THb3LgfxyplGYQsNc+SIOc92zl68+Aot//kL6SL6omBD7EKDHdhQz+5ggCKcMewWINLXbhxfU+EifSe5cn3c6niyhSese6HldUMtc7jzluP5QJFkVAxERJOXPXusfSopH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AlWzNyJZB2DMJyFPH/rzCR4mBInFWtRx9k3xs9bMiD7NrCWyfOe1JzSe2QRMP5likYUQ4eN8x/UZNvBJ95NorJyLxVh/gq8LSaiB/iR7dr52+DQznS/FQQ8jwId8E2GoN3mOzMkaQHYIuwu4+il+5tJG2sF03Og W4BWbnlBvA/B10Ia4w+N6OaPcdiuQFWC46NcXh9452ZVm+sgFNFVeEIr8lg9ODnzAZmTrp3Poz1i3bmNzc8emOtRwwTj3PBBq/ X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-6e454.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: cadc468d-d045-4d4a-a4f2-08da0525f4f7 X-MS-Exchange-CrossTenant-AuthSource: PAXPR06MB7760.eurprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2022 19:16:21.1581 (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: DB7PR06MB5083 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:228305 Archived-At: > I think we should first understand the use case better. For starters, > I don't think I understand why an idle timer function should want to > call read-char with a time-out. It is a strange thing to do, IMO. The function in question is org-resolve-clocks-if-idle. It runs with a normal timer (not idle) every 60 seconds, and resolves the running org clock if (current-idle-time) is greater than the time specified by the variable org-clock-idle-time. To do so, it prompts the user for a character that indicates which action to take, with a prompt text that indicates the current idle time: "Clocked in & idle for X mins [jkKtTgGSscCiq]? ". To provide a relatively up-to-date current idle time in the prompt text, it reads the char with a timeout in the following loop: (while (or (null char-pressed) (and (not (memq char-pressed '(?k ?K ?g ?G ?s ?S ?C ?j ?J ?i ?q ?t ?T))) (or (ding) t))) (setq char-pressed (read-char (concat (funcall prompt-fn clock) " [jkKtTgGSscCiq]? ") nil 45))) Since the idle time is not reset after the character is read, this produces the bug I explained in https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00127.html, but otherwise I find it to be reasonable code. > Doesn't seem to be anything reachable from Lisp land. Adding a subr > that just calls timer_start_idle would be trivial, though. I think that particular bug with org-clock can be fixed with other workarounds that do not involve resetting the idle timer. No need to expose that code only for that if it isn't already exposed. > However, it sounds like we do this on purpose, to avoid problems with > idle timers that call sit-for. See the discussion that started here: > > https://lists.gnu.org/archive/html/emacs-devel/2006-08/msg00395.html > > The change installed at that time made read_char avoid restarting idle > timers when it is called with a non-nil END_TIME argument. However, I still think that if not a bug, this is at least inconsistent and probably deserving a footnote in the relevant section of the Emacs Lisp manual (https://www.gnu.org/software/emacs/manual/html_node/elisp/Idle-Timers.html).