Change default value of org-clock-x11-idle-program-name (was: org-x11idle-exists-p with emacs --daemon)

2022-10-30 Thread Ihor Radchenko
Max Nikulin writes: > x11idle as `org-clock-x11idle-program-name' default is questionable as > well. Debian, Arch, Gentoo have xprintidle packages and this tool have > some additional code. AFAIU, x11idle was a very old hard-coded default. Later, this variable had been introduced without

Re: org-x11idle-exists-p with emacs --daemon

2022-10-30 Thread Ihor Radchenko
Max Nikulin writes: > Ihor, what I do not like in your patch is that an external process is > unconditionally executed during load time. Earlier there was a (failed) > attempt to limit it to X11. > > - Unsure if Windows builds of Emacs may connect to X servers. > - MacOS does not use x11idle,

Re: org-x11idle-exists-p with emacs --daemon

2022-10-30 Thread Max Nikulin
Ihor, what I do not like in your patch is that an external process is unconditionally executed during load time. Earlier there was a (failed) attempt to limit it to X11. - Unsure if Windows builds of Emacs may connect to X servers. - MacOS does not use x11idle, it calls ioreg and perl instead.

Re: org-x11idle-exists-p with emacs --daemon

2022-10-29 Thread Ihor Radchenko
Max Nikulin writes: > On 28/10/2022 11:28, Ihor Radchenko wrote: >> >> * lisp/org-clock.el (org-x11idle-exists-p): Do not check if load-time >> `window-system' is `x'. Instead, rely on the check in >> `org-user-idle-seconds'. > > I would say that even there it is not strictly correct to test

Re: org-x11idle-exists-p with emacs --daemon

2022-10-29 Thread Max Nikulin
On 28/10/2022 11:28, Ihor Radchenko wrote: * lisp/org-clock.el (org-x11idle-exists-p): Do not check if load-time `window-system' is `x'. Instead, rely on the check in `org-user-idle-seconds'. I would say that even there it is not strictly correct to test `window-system', perhaps

Re: org-x11idle-exists-p with emacs --daemon

2022-10-28 Thread Ihor Radchenko
Julien Cubizolles writes: > Ihor Radchenko writes: > >> Does the attached patch work for you? > > Yes it does, thanks. Thanks for testing! Applied onto main. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a51bb2c448bab7665667471aa227e3e25dbbdced > Also, org-user-idle-seconds

Re: org-x11idle-exists-p with emacs --daemon

2022-10-28 Thread Julien Cubizolles
Ihor Radchenko writes: > Does the attached patch work for you? Yes it does, thanks. Also, org-user-idle-seconds uses (eq window-system 'x) which according to its docstring should be replaced by (display-graphic-p). I've tested the change and it's working, with the added advantage that it works

Re: org-x11idle-exists-p with emacs --daemon

2022-10-27 Thread Ihor Radchenko
Max Nikulin writes: >>> emacsclient --eval '(server-select-display (getenv "DISPLAY"))' >> >> You are talking about a different problem. >> Please start a new thread. > > Nope > > emacs -Q -L ~/src/org-mode/lisp/ --daemon > emacsclient --eval window-system > nil > > emacsclient --eval

Re: org-x11idle-exists-p with emacs --daemon

2022-10-27 Thread Max Nikulin
On 28/10/2022 11:29, Ihor Radchenko wrote: Max Nikulin writes: I am not familiar with `org-x11idle-exists-p', but a problem with access of X clipboard from :immediate-finish capture templates may be quite similar. The following command creates a hidden X11 frame if no visible one exists:

Re: org-x11idle-exists-p with emacs --daemon

2022-10-27 Thread Ihor Radchenko
Julien Cubizolles writes: > All the org-*-idle-seconds func test at some point for > org-x11idle-exists-p which is defvar-ed at load time. > > For me, org-x11idle-exists-p is always nil at startup, but is set to > true if I eval it later on. I guess it's because I'm starting Emacs in > daemon

Re: org-x11idle-exists-p with emacs --daemon

2022-10-27 Thread Ihor Radchenko
Max Nikulin writes: > I am not familiar with `org-x11idle-exists-p', but a problem with access > of X clipboard from :immediate-finish capture templates may be quite > similar. The following command creates a hidden X11 frame if no visible > one exists: > > emacsclient --eval

Re: org-x11idle-exists-p with emacs --daemon

2022-10-27 Thread Max Nikulin
On 28/10/2022 05:31, Julien Cubizolles wrote: For me, org-x11idle-exists-p is always nil at startup, but is set to true if I eval it later on. I guess it's because I'm starting Emacs in daemon mode, (as a systemd user service actually), and org-x11idle-exists-p relies on (eq window-system 'x)

org-x11idle-exists-p with emacs --daemon

2022-10-27 Thread Julien Cubizolles
All the org-*-idle-seconds func test at some point for org-x11idle-exists-p which is defvar-ed at load time. For me, org-x11idle-exists-p is always nil at startup, but is set to true if I eval it later on. I guess it's because I'm starting Emacs in daemon mode, (as a systemd user service