From: Nicolas Calderon <nicolas.calderon.asselin@gmail.com>
To: nicholas.dokos@hp.com
Cc: Bastien <bzg@gnu.org>, emacs-orgmode@gnu.org
Subject: Re: A bit of work around org-clock-idle-time
Date: Sat, 28 Jul 2012 05:30:41 -0400 [thread overview]
Message-ID: <CAHbMD+HsTT9LoqQxbnsSb71PKXt3J9Y8pX7cXdUJYFv1zCoJxw@mail.gmail.com> (raw)
In-Reply-To: <28102.1343445599@alphaville>
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 <nicholas.dokos@hp.com> wrote:
> Nicolas Calderon <nicolas.calderon.asselin@gmail.com> 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 <nicholas.dokos@hp.com> wrote:
> Bastien <bzg@gnu.org> wrote:
>
>> Nick Dokos <nicholas.dokos@hp.com> 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
next prev parent reply other threads:[~2012-07-28 9:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 20:38 A bit of work around org-clock-idle-time Nicolas Calderon
2012-07-18 22:43 ` Nick Dokos
2012-07-27 23:43 ` Bastien
2012-07-28 3:19 ` Nick Dokos
2012-07-28 9:30 ` Nicolas Calderon [this message]
2012-07-28 9:54 ` Bastien
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=CAHbMD+HsTT9LoqQxbnsSb71PKXt3J9Y8pX7cXdUJYFv1zCoJxw@mail.gmail.com \
--to=nicolas.calderon.asselin@gmail.com \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=nicholas.dokos@hp.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).