From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lloyd Zusman Newsgroups: gmane.emacs.devel Subject: Asynchronous events in Carbon or Cocoa Emacs (macosx) Date: Fri, 10 Oct 2008 23:51:22 +0000 (UTC) Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1223682924 30821 80.91.229.12 (10 Oct 2008 23:55:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Oct 2008 23:55:24 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 11 01:56:22 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KoRqH-0000gz-DC for ged-emacs-devel@m.gmane.org; Sat, 11 Oct 2008 01:56:21 +0200 Original-Received: from localhost ([127.0.0.1]:46234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KoRpD-0002cx-Cd for ged-emacs-devel@m.gmane.org; Fri, 10 Oct 2008 19:55:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KoRp8-0002ci-Kd for emacs-devel@gnu.org; Fri, 10 Oct 2008 19:55:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KoRp7-0002cS-22 for emacs-devel@gnu.org; Fri, 10 Oct 2008 19:55:10 -0400 Original-Received: from [199.232.76.173] (port=38278 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KoRp6-0002cP-Ts for emacs-devel@gnu.org; Fri, 10 Oct 2008 19:55:08 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:52081 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KoRp6-0000Xu-Kl for emacs-devel@gnu.org; Fri, 10 Oct 2008 19:55:08 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1KoRp1-0006qc-6s for emacs-devel@gnu.org; Fri, 10 Oct 2008 23:55:03 +0000 Original-Received: from nadie.us ([216.27.138.216]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Oct 2008 23:55:03 +0000 Original-Received: from ljz by nadie.us with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 Oct 2008 23:55:03 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 55 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 216.27.138.216 (Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104471 Archived-At: I'm not sure whether the following question is appropriate in this forum. I've posted it in a few other emacs-related mailing lists and newsgroups, but no one has responded. I figure that you developers might understand this issue best, and you might be able to quickly answer my question. Please forgive me if I have misjudged and should have not posted this here. Under macosx (Leopard), I can run the latest builds of Carbon Emacs (22.3.1) or Cocoa Emacs (23.0.60) inside of a Terminal window by invoking the following command lines from within Terminal: /path/to/Contents/MacOS/Emacs -nw FILE ... where FILE is the item that I want to edit. If I run it in this way, events handled via Emacs' `special-event-map' are invoked asynchronously and in real time ... or at least in near-real time (they're processed the next time that Emacs becomes idle). For example, if I define a [sigusr1] event, its `special-event-map' handler gets invoked the next moment that Emacs goes idle after I send a USR1 signal to its process. This is the behavior that I am expecting. However, if I run Carbon or Cocoa Emacs without the `-nw' flag so that it creates and manages its own window outside of Terminal, these `special-event-map' events don't get invoked in near-real time any more, but rather, they only get processed the next time I interact directly with the Emacs window with either the mouse or a keystroke. In other words, if I am trapping [sigusr1] as described above and send a USR1 signal to the process, nothing happens until after I click in the Emacs window with the mouse or perform some sort of keyboard interaction with it, at which time the [sigusr1] events that have accumulated all get processed, one after the other. It's as if the windowed version of Carbon and Cocoa Emacs can only process `special-event-map' events in synchronization with the keyboard and mouse input queues. Or perhaps the explanation is that these versions of Emacs don't consider themselves to be in an idle state except immediately after they've finished processing keyboard and mouse events. Or maybe there's a different explanation for this; I'm not an Emacs developer, so I'm only guessing. Has anyone else seen this behavior? If so, is there any way that you know of to tell the windowed version of Carbon/Cocoa Emacs to process [sigusr1] and other `special-event-map' events asynchronously from the keyboard and mouse, in the same way that they get processed when Emacs is started in a Terminal window with the `-nw' option? Thanks in advance. -- Lloyd Zusman ljz@asfast.com God bless you.