emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Roméo La Spina" <romeo.laspina1@gmail.com>
To: Ignacio Casso <ignaciocasso@hotmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Resolving idle clocks needs multiple keystrokes [9.5.2 (release_9.5.2-24-g668205 @ /home/ignacio/repos/emacs/lisp/org/)]
Date: Sat, 19 Mar 2022 13:29:12 +0100	[thread overview]
Message-ID: <874k3uce6q.fsf@gmail.com> (raw)
In-Reply-To: <PAXPR06MB77608E83520482D07CBF7773C6149@PAXPR06MB7760.eurprd06.prod.outlook.com>

Hmm, I see the problem. I didn't think about that.
Thank you very much for your suggestion. But what about using read-char-exclusive? It seems to have a timeout argument too, and should apparently fix the issue (ie. the prompt will no longer disappear at the first unintentional click). 

Romeo

Ignacio Casso <ignaciocasso@hotmail.com> writes:

>> Hi,
>>
>> I don't know how closely it is related to your problem, but I've
>> reported another issue revolving around the use of read-char for the
>> prompt to resolve clocks.  See
>> [[https://lists.gnu.org/archive/html/emacs-orgmode/2022-02/msg00278.html]].
>>
>> Unfortunately I an not advanced enough in Elisp to know whether using
>> another function than read-char would solve your problem as well as
>> mine (maybe read-char-choice waits for a valid char, while resetting
>> the idle timer ?), but it might be a hint. What do you think ?
>
> The problem with `read-char-choice' is that it does not seem to have a
> timeout argument. `read-char' has, and `org-clock-resolve' uses it to
> update the prompt message with the current idle time every 45 seconds,
> calling (read-char ... 45) in a loop until it returns non-nil. With
> `read-char-choice' that would not be possible, and if
> `org-clock-idle-time' was N, after the N idle minutes, the prompt would
> appear saying something like "Emacs was idle for N minutes, what do you
> want to do?", but M minutes later the message would still be the same
> instead of replacing N with N+M.
>
> The patch I sent already fixes the bug I reported anyway. For yours, I
> suggest just wrapping `read-char' in `condition-case', unless someone
> knows of some other appropriate function.



  reply	other threads:[~2022-03-19 12:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87sfrnqlbu.fsf@hotmail.com>
2022-03-13 20:42 ` [BUG] Resolving idle clocks needs multiple keystrokes [9.5.2 (release_9.5.2-24-g668205 @ /home/ignacio/repos/emacs/lisp/org/)] Ignacio Casso
2022-03-19 10:07   ` Roméo La Spina
2022-03-19 11:08     ` Ignacio Casso
2022-03-19 12:29       ` Roméo La Spina [this message]
2022-03-20 12:21         ` Ignacio Casso
2022-03-20 21:02           ` Roméo La Spina
2022-10-16  5:22   ` Ihor Radchenko
2022-03-12 11:07 Ignacio Casso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k3uce6q.fsf@gmail.com \
    --to=romeo.laspina1@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ignaciocasso@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).