From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: poppyer Newsgroups: gmane.emacs.bugs Subject: bug#1578: emacsclient -c make emacs very slow (under Mac OSX) Date: Sat, 07 Feb 2009 02:26:50 +0800 Message-ID: References: <9E938C18-A92A-40BF-8741-F3781414D5FB@gmail.com> Reply-To: poppyer , 1578@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1233945887 20971 80.91.229.12 (6 Feb 2009 18:44:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Feb 2009 18:44:47 +0000 (UTC) Cc: 1578@emacsbugs.donarmstrong.com To: Adrian Robert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 06 19:46:01 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LVVi3-00018r-QQ for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Feb 2009 19:45:52 +0100 Original-Received: from localhost ([127.0.0.1]:39453 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVVgk-0003rd-G0 for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Feb 2009 13:44:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LVVft-0003Bo-GP for bug-gnu-emacs@gnu.org; Fri, 06 Feb 2009 13:43:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LVVfr-00039A-92 for bug-gnu-emacs@gnu.org; Fri, 06 Feb 2009 13:43:36 -0500 Original-Received: from [199.232.76.173] (port=60312 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LVVfr-000390-45 for bug-gnu-emacs@gnu.org; Fri, 06 Feb 2009 13:43:35 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:33906) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LVVfq-0002HK-Ez for bug-gnu-emacs@gnu.org; Fri, 06 Feb 2009 13:43:34 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n16IhWLT018673; Fri, 6 Feb 2009 10:43:32 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n16IZ2fV016305; Fri, 6 Feb 2009 10:35:02 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: poppyer Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs , owner@emacsbugs.donarmstrong.com Resent-Date: Fri, 06 Feb 2009 18:35:02 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1578 X-Emacs-PR-Package: emacs,ns X-Emacs-PR-Keywords: Original-Received: via spool by 1578-submit@emacsbugs.donarmstrong.com id=B1578.123394482615014 (code B ref 1578); Fri, 06 Feb 2009 18:35:02 +0000 Original-Received: (at 1578) by emacsbugs.donarmstrong.com; 6 Feb 2009 18:27:06 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.190]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n16IQvKi015007 for <1578@emacsbugs.donarmstrong.com>; Fri, 6 Feb 2009 10:26:59 -0800 Original-Received: by ti-out-0910.google.com with SMTP id 28so1131879tif.1 for <1578@emacsbugs.donarmstrong.com>; Fri, 06 Feb 2009 10:26:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=bGL5EIxdCZy2o4YyEYAOvHo52jRbvakTJVWHMY7yP3Y=; b=TaGINXRbQtKSh8O0cBX87aAZeFzE/z0vVihhF6ANcwSTw+Ij9MotJukGt0i71D2tBz Usjxu6xq9+WZOaRzYBytKzk3Zs20Y6Hgwez2dbiNROhTNmteO7cpoe2wgfm9f03HMSP/ J3lUw/Qns/yjD8aC4ZiwRa6JTSJRMKPSDxGTU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=s5yr8S7V64vYbkBwI029XrCQeeOjahVrzJ0qn0yGWrK3o6sf37Kb55a7AHL8i8liyA xT+Mzt6KOIubnZqzSN/q4Q5H3MfTXRcYWpaH14irxq4zRP5EWNB2L0WHOHUWY1RiTFy0 9d7ffd2NikNW+DWw3rjBJwVR1Wyke89GL2kkA= Original-Received: by 10.110.40.8 with SMTP id n8mr3137737tin.28.1233944816605; Fri, 06 Feb 2009 10:26:56 -0800 (PST) Original-Received: from nusnet-97-126.dynip.nus.edu.sg.yourcompany.com (nusnet-97-126.dynip.nus.edu.sg [137.132.97.126]) by mx.google.com with ESMTPS id a4sm945639tib.11.2009.02.06.10.26.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 06 Feb 2009 10:26:55 -0800 (PST) In-Reply-To: <9E938C18-A92A-40BF-8741-F3781414D5FB@gmail.com> (Adrian Robert's message of "Thu, 22 Jan 2009 01:02:45 +0200") User-Agent: Emacs Gnus X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Fri, 06 Feb 2009 13:43:36 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:25005 Archived-At: Adrian Robert writes: >> First, I use emacs -nw to open a normal emacs in the terminal. Then I >> use emacsclient -c to open a carbon frame. Now the terminal emacs >> becomes very slow and unresponsive. (But the CPU is not running high). >> Even after the carbon frame is closed, it is still same slow. (and I >> have to close emacs and restart) > > This is because the events are being passed only after a full run > through the NS event loop. See line 3194 in nsterm.m (the first one > of ns_select()). Ideally this would drop down to the regular select > () if the NS application ("carbon" frame) is not active. However, I > haven't found a way to detect this without also causing the problem > of failing to pick up the app becoming active again until after a > long delay. I think the select() gets called with a long timeout > and, no matter if cocoa-experimental-ctrl-g is set or not, no > interruption of it happens. > > Since there is only one thread, an external call to, e.g. - > applicationWillBecomeActive won't go through until after this select > terminates. I notice that if I start with "emacs -nw", there is no NSApp (no icon in the osx dock). When I use "emacsclient -c" to open a NS frame, the icon shows up. My idea here is, if I close every NS frame, can we destroy the NSApp and make it nil again (say by testing the frame count) ? If this is possible, it at least make emacsclient more usable; and I don't need to restart Emacs. Cheers, poppyer