emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* reevaluating org-x11idle-exists-p with new org-clock-x11idle-program-name
@ 2021-05-24  7:40 Julien Cubizolles
  2021-05-24 13:37 ` Tim Cross
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Cubizolles @ 2021-05-24  7:40 UTC (permalink / raw)
  To: emacs-orgmode

I'm using a custom python program to display x11 idle time. I've set
org-clock-x11idle-program-name accordingly but org-x11idle-exists-p is
still nil. I'm guessing it's defvar'ed in org-clock.el before
org-clock-x11idle-program-name is set. Evaluating the defvar of
org-x11idle-exists-p afterwards indeed sets it to t.

I could do (setq org-x11idle-exists-p t) but there must be a better way
to handle the definition of a new org-clock-x11idle-program-name.

-- 
Julien Cubizolles



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: reevaluating org-x11idle-exists-p with new org-clock-x11idle-program-name
  2021-05-24  7:40 reevaluating org-x11idle-exists-p with new org-clock-x11idle-program-name Julien Cubizolles
@ 2021-05-24 13:37 ` Tim Cross
  2021-05-25  8:37   ` Julien Cubizolles
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Cross @ 2021-05-24 13:37 UTC (permalink / raw)
  To: emacs-orgmode


Julien Cubizolles <j.cubizolles@free.fr> writes:

> I'm using a custom python program to display x11 idle time. I've set
> org-clock-x11idle-program-name accordingly but org-x11idle-exists-p is
> still nil. I'm guessing it's defvar'ed in org-clock.el before
> org-clock-x11idle-program-name is set. Evaluating the defvar of
> org-x11idle-exists-p afterwards indeed sets it to t.
>
> I could do (setq org-x11idle-exists-p t) but there must be a better way
> to handle the definition of a new org-clock-x11idle-program-name.

How are you setting org-clock-x11idle-program-name? In your init file or
via custom? 

Looking at the code, I would expect that provided
org-clock-x11idle-program-name is set before you load org-clock.el, it
should 'just work'. I think your right in your assumption it is not set
before org-clock.el is loaded. The question is why is org-clock.el being
loaded before you have set the program name?

There are a few possible reasons, depending on whether your setting the
program name with a setq in your init file, setting it via custom and
whether you have altered when custom settings are loaded or where in
your init file you load org.

I would probably just put a (setq org-clock-x11idele-program-name ...)
early in your init file to ensure it is set before org is loaded and all
should then work. 


--
Tim Cross


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: reevaluating org-x11idle-exists-p with new org-clock-x11idle-program-name
  2021-05-24 13:37 ` Tim Cross
@ 2021-05-25  8:37   ` Julien Cubizolles
  2021-05-26 13:47     ` Julien Cubizolles
  0 siblings, 1 reply; 4+ messages in thread
From: Julien Cubizolles @ 2021-05-25  8:37 UTC (permalink / raw)
  To: emacs-orgmode

Tim Cross <theophilusx@gmail.com> writes:

> Julien Cubizolles <j.cubizolles@free.fr> writes:
>
>> I'm using a custom python program to display x11 idle time. I've set
>> org-clock-x11idle-program-name accordingly but org-x11idle-exists-p is
>> still nil. I'm guessing it's defvar'ed in org-clock.el before
>> org-clock-x11idle-program-name is set. Evaluating the defvar of
>> org-x11idle-exists-p afterwards indeed sets it to t.
>>
>> I could do (setq org-x11idle-exists-p t) but there must be a better way
>> to handle the definition of a new org-clock-x11idle-program-name.
>
> How are you setting org-clock-x11idle-program-name? In your init file or
> via custom? 

Setting it via custom works thanks. Somehow org was loaded by some
dependency before I explicitly used (require 'org). I guess I could also
use some use-package configuration.
-- 
Julien Cubizolles



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: reevaluating org-x11idle-exists-p with new org-clock-x11idle-program-name
  2021-05-25  8:37   ` Julien Cubizolles
@ 2021-05-26 13:47     ` Julien Cubizolles
  0 siblings, 0 replies; 4+ messages in thread
From: Julien Cubizolles @ 2021-05-26 13:47 UTC (permalink / raw)
  To: emacs-orgmode

Julien Cubizolles <j.cubizolles@free.fr> writes:

> Tim Cross <theophilusx@gmail.com> writes:
>
>> Julien Cubizolles <j.cubizolles@free.fr> writes:
>>
>>> I'm using a custom python program to display x11 idle time. I've set
>>> org-clock-x11idle-program-name accordingly but org-x11idle-exists-p is
>>> still nil. I'm guessing it's defvar'ed in org-clock.el before
>>> org-clock-x11idle-program-name is set. Evaluating the defvar of
>>> org-x11idle-exists-p afterwards indeed sets it to t.
>>>
>>> I could do (setq org-x11idle-exists-p t) but there must be a better way
>>> to handle the definition of a new org-clock-x11idle-program-name.
>>
>> How are you setting org-clock-x11idle-program-name? In your init file or
>> via custom? 
>
> Setting it via custom works thanks. Somehow org was loaded by some
> dependency before I explicitly used (require 'org). I guess I could also
> use some use-package configuration.

Actually it doesn't… Even with org-clock-x11idle-program-name set via
custom, org-x11idle-exists-p is still nil at startup. And
custom-set-variables is set at the very beginning of my init file. I'll
file an issue.


-- 
Julien Cubizolles



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-05-26 13:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-24  7:40 reevaluating org-x11idle-exists-p with new org-clock-x11idle-program-name Julien Cubizolles
2021-05-24 13:37 ` Tim Cross
2021-05-25  8:37   ` Julien Cubizolles
2021-05-26 13:47     ` Julien Cubizolles

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).