[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] A bit of work around org-clock-idle-time
From: |
Nicolas Calderon |
Subject: |
Re: [O] A bit of work around org-clock-idle-time |
Date: |
Sat, 28 Jul 2012 05:30:41 -0400 |
Sorry, I forgot to reply to all when Nicolas D. answered the first
email and took it off the list. Here is what you missed regarding
org-clock.el:
On Thu, Jul 19, 2012 at 2:33 PM, Nick Dokos <address@hidden> wrote:
> Nicolas Calderon <address@hidden> wrote:
>
>>
>> As for the max solution for idle time, I don't think it's a good
>> solution. It solves the case where x11idle always return 0, but if
>> you're active in X (x11idle always low) but not in emacs (high idle
>> time), you'll end up in clock resolving mode.
>>
>
> Fair enough, but it can still be done so as to simulate today's behavior
> while avoiding the 0 case. Something like
>
> ((eq window-system 'x)
> (let ((idle (org-x11-idle-seconds)))
> (if (> idle 0)
> idle
> (org-emacs-idle-seconds))))
The problem I see here is that 0 is a valid output for x11idle, so if
the check is done while X11 is not idle, it will fall back to
org-emacs-idle-seconds. From what I could see in the
shell-command-to-string, there is no way to tell between an output
from the program and the 0 the function returns if there is no output
(can't find the command). That's why I added the additional check for
the command existence.
Optimally, that check would be done once at startup or the first time
idle time is checked but I lack the elisp skills to perform such a
"feat".
That being said, the patch was merged in, so I don't know if it's an
indication that I should not worry.
Thanks,
--
Nicolas Calderon
On Fri, Jul 27, 2012 at 11:19 PM, Nick Dokos <address@hidden> wrote:
> Bastien <address@hidden> wrote:
>
>> Nick Dokos <address@hidden> writes:
>>
>> > o in org-clock.el, instead of checking whether x11idle exists or not, how
>> > about something like this:
>> >
>> > ...
>> > (eq window-system 'x)
>> > (max (org-x11-idle-seconds) (org-emacs-idle-seconds))
>> > ...
>>
>> Yes, this is cleaner, thanks!
>>
>
> Cleaner maybe, but it's not correct, as Nicolas C. pointed out. Nicolas
> C. and I had an email exchange and I hope he will follow up with revised
> patches.
>
> Nick