From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EA0cAxLOOGLpZAEAgWs5BA (envelope-from ) for ; Mon, 21 Mar 2022 20:12:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id gCRbNxHOOGI/EwEAG6o9tA (envelope-from ) for ; Mon, 21 Mar 2022 20:12:17 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6F98638099 for ; Mon, 21 Mar 2022 20:12:17 +0100 (CET) Received: from localhost ([::1]:35508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nWNRw-0001pe-04 for larch@yhetil.org; Mon, 21 Mar 2022 15:12:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nWNRC-0001pO-KM for emacs-orgmode@gnu.org; Mon, 21 Mar 2022 15:11:30 -0400 Received: from [2a00:1450:4864:20::32f] (port=33064 helo=mail-wm1-x32f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nWNRB-0002Rj-0G for emacs-orgmode@gnu.org; Mon, 21 Mar 2022 15:11:30 -0400 Received: by mail-wm1-x32f.google.com with SMTP id o7-20020a05600c4fc700b0038c87edc21eso458239wmq.0 for ; Mon, 21 Mar 2022 12:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=HOM367reu/xD4a71cOgisY080e0N2YDGCrb5W3Nirlg=; b=QHaE0OrHiAZZMEeFOQjOfSX2hitGeWOMaccq6yYaLfS/03U62hpnB1aEV6t3hVcGrN N0IR3jZRtGNJ0qftRnvlOI0mK716J13n9zxgbeC+F8G0EkhtkRUAeNumWhusLNW6QH4O JPvfezoIFBJ/onu+fCufaZB1QpmhIrWcvWB/1oWJ+ZwS5gby2d6W3ocW6G8iNvhb/Sr2 WMqmInPeytKtIKVzMT4dWAjVVB8R/f2Q1XZ0WTLa+s2DK4aae83hVZY62Go7Sm6zBwnT gcZ2NnxE142P4r0rWxrsuxPgWhFVJgej7vmz7/F9O8d9yUNY/x7bPu83YZWfqcP134DH L4xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=HOM367reu/xD4a71cOgisY080e0N2YDGCrb5W3Nirlg=; b=jk1N+QmD0o/yBAbygATBw1t+XlnoyqB4FcdvzreMsfzo41p1SEIdzfDo/cptzISbR7 cDeSbih7aLvLXFVd1B00T9Soqcpr5jJtKJNmn0rvwMoh+bI4ZY8TWxl/fXt50zQizvDS RuOwXkflGzCe8Egspew8/uGSQpAUMoWSNz2ok0bRh4tlDGadnPmwQ5NWDVMzenxvh4ib CEFV1hjNyE+L7qT9Nzho2yB+k6X3/bj9Z1uGL4OwMnFJlVEK+XYiDRAyK2xNGyR/yFpe vXzunjp2FRkqYu+UY52QnvDq6PCBoPO3M5uS8galjloobDDONYYwEWmKz3U3rbKuxHGI EQGA== X-Gm-Message-State: AOAM530JbEhMCuaagIaJ20Bazcx+gvqCDUgebERA3c9g5R7c/t9CHOQL VGigFI7HkwFr3s9Qp4Y7JNEdZE44iBM= X-Google-Smtp-Source: ABdhPJykZGbd/wWqcU5pkBsCBjjJrcqL9+7fgaNufOeUUkRLWJo210a/i3XKqlHVtQgfnQ8VEWBLjQ== X-Received: by 2002:a05:600c:3b1c:b0:389:8677:6c73 with SMTP id m28-20020a05600c3b1c00b0038986776c73mr515818wms.192.1647889887415; Mon, 21 Mar 2022 12:11:27 -0700 (PDT) Received: from ARCH-RLS.gmail.com (2a01cb0890110e0095a3e704c498f8cb.ipv6.abo.wanadoo.fr. [2a01:cb08:9011:e00:95a3:e704:c498:f8cb]) by smtp.gmail.com with ESMTPSA id m3-20020a5d64a3000000b00203ed35b0aesm18644018wrp.108.2022.03.21.12.11.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 12:11:26 -0700 (PDT) References: <87o82yaeie.fsf@gmail.com> User-agent: mu4e 1.6.10; emacs 27.2 From: =?utf-8?Q?Rom=C3=A9o?= La Spina To: emacs-orgmode@gnu.org Subject: [PATCH] Re: Prompt when resolving clocks [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)] Date: Mon, 21 Mar 2022 20:03:27 +0100 In-reply-to: <87o82yaeie.fsf@gmail.com> Message-ID: <87lex3f7ds.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::32f (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=romeo.laspina1@gmail.com; helo=mail-wm1-x32f.google.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647889937; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=HOM367reu/xD4a71cOgisY080e0N2YDGCrb5W3Nirlg=; b=sB40r7CZTvuLWIkZtz4BmkZa1pS7+MonJ5j7g1hYGHEDXz5r8rpoMwpMG/VmRP0XpNZ0gz wtwW/cavcgNLLycoH3OtV4w5DRYF4okx56A7Xi3fjzoT0A1nhpCVKAhdi3RtJpdKGV0yb9 dKJ4kFoHywIsJzgzVYvrL7qFFtYzly8JtKYWXb7OUSoVLGmRh16uWzvnQV0BQgMYG/TFIc l3P4YvkXSsVIa7lQLk4P/upE5+8cZp/zEm3MVEu7QdF9Zvg57AyAOVdWTN7yQfcJFaxxsK awFapsGkahcfaleydOBbeePNFl8P46UYKDluKZSXgrvvTXWakBfNuJvxhToqZg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647889937; a=rsa-sha256; cv=none; b=oF1rrOUgEVlx6tyOGWRcKz1L2u0vi38/evgp2mfgE6FPctW81ANl0RemQ+FC6kASyuArP5 hhT9LmyWvFTIIc88MRuimPya16+Zh41yInX7auN7kBWJAePdl5nQA2bLq4Zqb9tXvmEGPd gF7dVK75/5tSx2DaHB9PimDDjwLUP6xRqEoDysbMc1qphYaehxIxPIDdtbNJv03CPwuFdb +qVT9vCei7HNU2bfMn5oeAkjIGCSOZzYeRt2rJcUrnRgsobqsvJDKgeoRdXQMSLB0ME61x /ff5ZwIWLv3wsQJRgObyq3ANPy9m74lavjwFVWebXltv72UyzHHuAaICeuv1nQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QHaE0OrH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=QHaE0OrH; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6F98638099 X-Spam-Score: -4.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: 3YXyXImao8Zr --=-=-= Content-Type: text/plain Hello, After some discussion on the subject on another topic (see https://lists.gnu.org/archive/html/emacs-orgmode/2022-03/msg00233.html), I have a small patch that prevents the prompt for disappearing on unwanted events, using `read-char-exclusive'. You will find it enclosed. Regards, Romeo --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-lisp-org-clock.el-Fix-bug-in-prompt-for-resolving-cl.patch >From 0078523a768f215d8053905f66266cb1d083a7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rom=C3=A9o=20La=20Spina?= Date: Mon, 21 Mar 2022 20:00:43 +0100 Subject: [PATCH] lisp/org-clock.el: Fix bug in prompt for resolving clocks * lisp/org-clock.el (org-clock-resolve): Avoid unwanted disappearing of the prompt when clicking somewhere, by using `read-char-exclusive' instead of `read-char'. TINYCHANGE --- lisp/org-clock.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 6f441c18e..f7d25599c 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1099,9 +1099,9 @@ to be CLOCKED OUT.")))) ?j ?J ?i ?q ?t ?T))) (or (ding) t))) (setq char-pressed - (read-char (concat (funcall prompt-fn clock) - " [jkKtTgGSscCiq]? ") - nil 45))) + (read-char-exclusive (concat (funcall prompt-fn clock) + " [jkKtTgGSscCiq]? ") + nil 45))) (and (not (memq char-pressed '(?i ?q))) char-pressed))))) (default (floor (org-time-convert-to-integer (time-since last-valid)) -- 2.35.1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Rom=C3=A9o La Spina writes: > Remember to cover the basics, that is, what you expected to happen and > what in fact did happen. You don't know how to make a good report? See > > https://orgmode.org/manual/Feedback.html#Feedback > > Your bug report will be posted to the Org mailing list. > ------------------------------------------------------------------------ > > Hello, > > I have a little problem concerning org-clock. > When resolving clocks, either because of a long idleness or because of > dangling clocks, there is a prompt to ask the user if they want to keep > idle time, substract it, etc... > But when another event than the response occurs (typically, I come back > to my computer, I don't see the prompt and I click somewhere), an > exception "Non-character input event" is raised, and the prompt > disappear, making it impossible to resolve the clock later. > > When googling the error message I saw that the problem might be due to > the use of the function read-char when prompting the user, which is > indeed used in the function that resolve clocks. > > Is there a solution to wait for the user to answer the prompt, like a > classical yes-no prompt? > > Best regards, > > Romeo > > Emacs : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.= 27, cairo version 1.17.4) > of 2021-03-26 > Package: Org mode version 9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/li= sp/org/) --=-=-=--