From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 UL97OKxaW2PiWgEAbAwnHQ (envelope-from ) for ; Fri, 28 Oct 2022 06:29:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +CB8OKxaW2NtewAA9RJhRA (envelope-from ) for ; Fri, 28 Oct 2022 06:29:32 +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 95B462EABC for ; Fri, 28 Oct 2022 06:29:31 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooGyl-0001t3-GS; Fri, 28 Oct 2022 00:28:23 -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 1ooGyj-0001sm-Q6 for emacs-orgmode@gnu.org; Fri, 28 Oct 2022 00:28:21 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ooGyh-0006Ss-T7 for emacs-orgmode@gnu.org; Fri, 28 Oct 2022 00:28:21 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 78419240101 for ; Fri, 28 Oct 2022 06:28:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1666931298; bh=cOxD/5LS5rBhjsdh7s1TC7YoyxvOnuvEKk2OJKX4mdU=; h=From:To:Cc:Subject:Date:From; b=qnxlMYr514/JTEft2ZERewtqHJSUeJqL81yCcqoSGQ/1uLZTMflMT/vh/GywUfFTQ CDKEg/wPOF3wojwCJGoHFXrnSkTEZaEW61noDhJTGrzuwVZqtsDh+oconl88AqMgky MRMDjvRhXQOvpm4e44ODIhPQ5vA12zIHyJ05aMcXHcY1FMXUHTHAgESWVxW0zT6uBf D5esYgZ560DvA41tjMQ0Tya+s88AjD6WhdN8XM0A5+OQC5Jz2IElxiNBQZJCiBXFp6 junNKGzKgNTwayS5eOkDhCxuo+iItbtRUZFhyBz5Dfyo2g5yEw7L+DXZTCQMpJ0FGm TKVv+vedF+/Sg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Mz8g41Lhyz9rxB; Fri, 28 Oct 2022 06:28:15 +0200 (CEST) From: Ihor Radchenko To: Julien Cubizolles Cc: emacs-orgmode@gnu.org Subject: Re: org-x11idle-exists-p with emacs --daemon In-Reply-To: <871qqs6gqs.fsf@free.fr> References: <871qqs6gqs.fsf@free.fr> Date: Fri, 28 Oct 2022 04:28:59 +0000 Message-ID: <87y1t0lgfo.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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=1666931371; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=29Bakk+uST96thbOKTE7QGg9eRVILjMAF8kAz0nfzWM=; b=b2TTauFlHSjCJ4Neo8h8eap7ipxK+Rk3J4olXfetPQzrSdMJF3yABalJ4zlrqVGSmMX39M JmvptoEuqr7VQZEJRACY6SSJK/zjNP+BufO/9kiGWeKKH3KPhSaR0AS5wK+yL59kLf25b9 7ZPcApKWW9kp0Wh0C4PeUyB/tET4B3eL/2+4wqADu7LpSkuesW1qlwAg47pX+YjHyRG3on 2QTDmT5/AOORO3EesAFW9Uw5r34FsEqokLqK4Vy/I33Tzvxl/puL3/efehNmtpR07rE2VG bYob4Zcrr3g7r8SNXFINlVv75kzwB1sVN1D5Tn6cXqbrFPnxlEALLuPPwcMb7A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666931371; a=rsa-sha256; cv=none; b=uD/leC41TVWyHjIUIdhpqcoF5PilT/2iFIN0VWQM6+hYJDz4Q4LicOdg1eDxx1LY1oM8r5 aoRPyU3/i1UwVNlUUCrebvwJAISaVA21Sh2MpxSz+i2Wd2ORF7WHbgzReV13Bil7Q7fzTV +dlNY3JNPBFRQc1H5XF+ecwTZnmQzO4s3jePdpq85RNyfUXMyviC4hpbUVNKlHfbcsCHe+ G25ij1l9O4KFhkfAWxgMtnyRSeTAX6MV/g8Y/eHMUHuSxM1Wa4sDVZJSA5Iak4qecI6idf /kZNq4WKGXml90KhMcwQ93Rx4e1zN19Q0ll+vpW2ZcXNQfhPr306UU94vmo1AA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=qnxlMYr5; dmarc=pass (policy=none) header.from=posteo.net; 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: -3.41 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=qnxlMYr5; dmarc=pass (policy=none) header.from=posteo.net; 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: 95B462EABC X-Spam-Score: -3.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: AHW1AdeHvAKn --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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.=20 > > 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) which is somehow > not set in the terminal when the daemon. > > For the time being, it manually set org-x11idle-exists-p to true but > shouldn't all this tests on (eq-window-system) be run each time a new > frame is created=C2=A0? Does the attached patch work for you? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-x11idle-exists-p-Do-not-demand-X-window-system-a.patch >From 95ec1073ab27bbfe522b25c9852f1e5e85e38e32 Mon Sep 17 00:00:00 2001 Message-Id: <95ec1073ab27bbfe522b25c9852f1e5e85e38e32.1666931293.git.yantar92@posteo.net> From: Ihor Radchenko Date: Fri, 28 Oct 2022 12:26:09 +0800 Subject: [PATCH] org-x11idle-exists-p: Do not demand X window system at load time * 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'. Emacs may start as a daemon and hence `window-system' may not yet be `x' during startup. Reported-by: Julien Cubizolles Link: https://orgmode.org/list/871qqs6gqs.fsf@free.fr --- lisp/org-clock.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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))) ;; Check that x11idle can retrieve the idle time ;; FIXME: Why "..-shell-command" rather than just `call-process'? -- 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--