From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WKePB80dXWOM4AAAbAwnHQ (envelope-from ) for ; Sat, 29 Oct 2022 14:34:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SEuJBs0dXWM9VAEAG6o9tA (envelope-from ) for ; Sat, 29 Oct 2022 14:34:21 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CC87728D75 for ; Sat, 29 Oct 2022 14:34:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ool1Z-00013g-6J; Sat, 29 Oct 2022 08:33:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ool1W-00011y-DO for emacs-orgmode@gnu.org; Sat, 29 Oct 2022 08:33:15 -0400 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ool1V-0002dI-2M for emacs-orgmode@gnu.org; Sat, 29 Oct 2022 08:33:14 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1ool1S-0008IE-96 for emacs-orgmode@gnu.org; Sat, 29 Oct 2022 14:33:10 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: org-x11idle-exists-p with emacs --daemon Date: Sat, 29 Oct 2022 19:33:04 +0700 Message-ID: References: <871qqs6gqs.fsf@free.fr> <87y1t0lgfo.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-US In-Reply-To: <87y1t0lgfo.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 26 X-Spam_score: 2.6 X-Spam_bar: ++ X-Spam_report: (2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Emacs-orgmode" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667046860; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XlorkOo3NnkAQfV5FbssSwNFlE+IL9cD17p18BITmLY=; b=KepbNyxd8Pw6wU8RzC1YgWmF+p76gXSS4lCWfT7rZEJ+0d9DCe0VNhh1Qf8x8S62hIb0j8 eEOhBoBpKQEtBXeP04N17d9HBzaqgZzD/sUOSbsroATeF1G5E/JXiz2SQ7Zg4b4c8NWQNn DNYhybRryKf3jthAE8HcKuicPTpXfm1mdnQIU3shLiPUK3jTSBqwQeSiFCLxunH/QmKbMG dlzhEiiNwNxs4gOFjM+dMOystAVF5pAHHcZeU4HUx4rR9gxe7WU116jvEqq/tZs0XAQIAp eyi/edZeFgyX0TWzcVLS5c03BukZozJIcqyDVaM5CbKre5t0kiyVGYL3eWINPA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667046860; a=rsa-sha256; cv=none; b=dQT28US83++KXy7fBWyQWcS7lWbSkEAuDfNm9wEXq1ftWuCt6sG1CpORIpSQUw6v388Msg ac/wY0H8xG5zFHp3Tnlu977g8VWIpGCMnBESAeHK8UpNaCGhQF3b88cPzBTO8NU4x1Cq1b s37NatHNl2nh1wYs+6E0aGk4MvQ42xfYDBI3uq64bq4Pe3VTYRAa8zRybe2zhmQBSiyEKG LOlM+hRfWZuAH/8xC4L6tKHd3vqUYtFs+YAllgN2GkxU3Mj08nKUf5NNY85nuZv8cHrRZJ fr64Sgclh6QvsIfXKx0d8LV7lkr2aTKvJDcEnRrzsj0cABE7le1Ael4GOnJ4Yw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 4.27 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CC87728D75 X-Spam-Score: 4.27 X-Migadu-Scanner: scn1.migadu.com X-TUID: CY8Yy/t4hXFj 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 `x-display-list' is a bit better since particular frame may be a terminal one running in xterm, but user has x frames. In server.el I found (frame-parameter frame 'display) that might be even better and should work with daemon having a single frame in xterm. I can not figure out if --display command line option affects some variable of Emacs daemon. Another tricky case is multiple x connection to different displays. It seems GTK3 have some limitations (pgtk build) and such rarely used configuration will become completely obsolete. > diff --git a/lisp/org-clock.el b/lisp/org-clock.el > index e98a34f0d..ca026c44f 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -1201,8 +1201,7 @@ (defun org-mac-idle-seconds () > > (defvar org-x11idle-exists-p > ;; Check that x11idle exists > - (and (eq window-system 'x) > - (eq 0 (call-process-shell-command > + (and (eq 0 (call-process-shell-command > (format "command -v %s" org-clock-x11idle-program-name))) I joined to this discussion presuming (by some confusion) that such variable should be lazily initialized on first call of `org-user-idle-seconds'. I considered `window-system' test as a way to distinguish GUI and text Emacs sessions. Actually such parameter is dynamic. Remotely running Emacs may be disconnected from one X server and connected to another session. Actually `window-system' check has another role: skip command availability test on systems other than Linux. What is the result of "command -v" on Windows? Should it be executed there at all (unconditionally at load time)? P.S. There are a number of X11 servers for Windows. I am unsure if Emacs builds for Windows and X11 frames are supported. I am lost how to properly test such cases in the code.