emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Calderon <nicolas.calderon.asselin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: A bit of work around org-clock-idle-time
Date: Wed, 18 Jul 2012 16:38:06 -0400	[thread overview]
Message-ID: <CAHbMD+EqDFc3qRn=VYqL4+_TYTsNp+Ttx=McV-HXtu2__qD8VQ@mail.gmail.com> (raw)

Hello,

I was trying to get org-clock-idle-time to work on my machine, but it
would never kick in. Looking at the doc
(http://orgmode.org/manual/Resolving-idle-time.html), I was left under
the impression that x11idle was an option for a better experience, but
emacs idle time would be used otherwise. After digging around a bit, I
found out it was not the case. If you are using X, emacs WILL use
x11idle, wether you have it or not, and in the latter case always get
an idle time of 0.

From that, I have two patches to submit (next 2 emails):

I made a few modifications to x11idle itself. It seemed it could crash
in many ways, one that was noted in comments but somehow not averted
by the addition of a if. I added a few more checks, and made it return
more meaningful error codes (more on that later).


Since org-mode doesn't depend on x11idle being installed on the
machine (at least not on debian), I thought it could be interesting to
add a few checks. First of all, I make sure that the command exists (I
used this post to do it the most generic way,
http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script),
and then, that the command can execute properly (can connect to the
display, there is enough memory for the info struct and the reporting
of idle time is supported). I'm not sure this is the best
implementation (how often does this get called? If it's often, it
might be worth caching the results rather than invoking two shell
commands every time), but that's as good as I could do with my
knowledge of lisp (none, as of before looking into this).

Hopefully, all this will respect what I read here:
http://orgmode.org/worg/org-contribute.html.

Thanks,

--
Nicolas Calderon

             reply	other threads:[~2012-07-18 20:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-18 20:38 Nicolas Calderon [this message]
2012-07-18 22:43 ` A bit of work around org-clock-idle-time Nick Dokos
2012-07-27 23:43   ` Bastien
2012-07-28  3:19     ` Nick Dokos
2012-07-28  9:30       ` Nicolas Calderon
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+EqDFc3qRn=VYqL4+_TYTsNp+Ttx=McV-HXtu2__qD8VQ@mail.gmail.com' \
    --to=nicolas.calderon.asselin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).