From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24849: Is Emacs put in idle mode when window is not focused? Date: Tue, 01 Nov 2016 18:22:14 +0200 Message-ID: <83oa1znpah.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1478017776 26830 195.159.176.226 (1 Nov 2016 16:29:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 1 Nov 2016 16:29:36 +0000 (UTC) Cc: 24849@debbugs.gnu.org To: Johan Andersson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 01 17:29:26 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1bvy-00042L-8l for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Nov 2016 17:29:10 +0100 Original-Received: from localhost ([::1]:49167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1bw0-0000bt-W4 for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Nov 2016 12:29:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1bq5-00047c-PP for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2016 12:23:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1bq2-0004gI-KV for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2016 12:23:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52004) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1bq2-0004g7-Gt for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2016 12:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c1bq2-0003h1-B8 for bug-gnu-emacs@gnu.org; Tue, 01 Nov 2016 12:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Nov 2016 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24849 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24849-submit@debbugs.gnu.org id=B24849.147801733314124 (code B ref 24849); Tue, 01 Nov 2016 16:23:02 +0000 Original-Received: (at 24849) by debbugs.gnu.org; 1 Nov 2016 16:22:13 +0000 Original-Received: from localhost ([127.0.0.1]:39170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1bpB-0003fd-8e for submit@debbugs.gnu.org; Tue, 01 Nov 2016 12:22:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1bpA-0003fO-2n for 24849@debbugs.gnu.org; Tue, 01 Nov 2016 12:22:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1bp0-0004Qs-WD for 24849@debbugs.gnu.org; Tue, 01 Nov 2016 12:22:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1bp0-0004Qo-Si; Tue, 01 Nov 2016 12:21:58 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4077 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c1bp0-0001Kk-4l; Tue, 01 Nov 2016 12:21:58 -0400 In-reply-to: (message from Johan Andersson on Tue, 1 Nov 2016 09:44:20 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:125218 Archived-At: > From: Johan Andersson > Date: Tue, 1 Nov 2016 09:44:20 +0100 > > I have written an Emacs package called Prodigy (https://github.com/rejeep/prodigy.el/). The package is used > to manage external services from within Emacs. A service is some kind of running process, usually a web > server or database. > > There has always been an issue that I have not investigated further. It seems that after a while, if Emacs is > not focused, it ends up in some idle mode. The effect is that requests are very slow, almost hangs for a few > seconds. If I focus the Emacs window, the request goes through immediately. > > The reason I'm asking about it now is that this has gotten even worse in Emacs 25. > > My question is if anyone knows what this is about and if it's possible to solve? Please describe in more detail what you package does and how it is related to "non-idle" Emacs. IOW, why does your package care whether Emacs is idle or not. My suspicion is that your package somehow assumes that the Emacs main loop is always running at the same fast speed, which is not true. In particular, when the frame doesn't have the focus, Emacs 25 stops the blinking cursor timer, and if that is the only high-frequency activity in Emacs (i.e. there's no other timers or external events that drive the event loop), then yes, Emacs will only crank the event loop at very low frequency. But I'm not sure this is related to your problem, because I don't know what does your package expect from Emacs.