From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Steven Tamm Newsgroups: gmane.emacs.devel Subject: Re: Mac OS X - Hang / C-g problem patch Date: Sat, 7 Dec 2002 22:15:21 -0800 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <6E796744-0A74-11D7-B27B-00039390AB82@mac.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v548) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1039328850 22922 80.91.224.249 (8 Dec 2002 06:27:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 8 Dec 2002 06:27:30 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18KuuW-0005xX-00 for ; Sun, 08 Dec 2002 07:27:28 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18Kv3z-0005LT-00 for ; Sun, 08 Dec 2002 07:37:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18KujF-00006i-07 for emacs-devel@quimby.gnus.org; Sun, 08 Dec 2002 01:15:50 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18Kuiv-00006a-00 for emacs-devel@gnu.org; Sun, 08 Dec 2002 01:15:29 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18Kuir-00005u-00 for emacs-devel@gnu.org; Sun, 08 Dec 2002 01:15:28 -0500 Original-Received: from a17-250-248-86.apple.com ([17.250.248.86] helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Kuiq-00005i-00 for emacs-devel@gnu.org; Sun, 08 Dec 2002 01:15:25 -0500 Original-Received: from asmtp01.mac.com (asmtp01-qfe3 [10.13.10.65]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id gB86FM2n003469 for ; Sat, 7 Dec 2002 22:15:22 -0800 (PST) Original-Received: from mac.com ([12.236.43.16]) by asmtp01.mac.com (Netscape Messaging Server 4.15) with ESMTP id H6SEPM00.9TL; Sat, 7 Dec 2002 22:15:22 -0800 Original-To: Andrew Choi In-Reply-To: X-Mailer: Apple Mail (2.548) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:9973 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9973 Hi Andrew (and others interested in this problem), I've checked in your patch with a few modification. First, I added code to check for C-g instead of C-. to macterm.c. Right now it will only work if the quit_char is C-g, but I plan on adding code that will convert from ascii -> keycode later. Anywhere this check should be done, call mac_check_for_quit_char(). Second, I made sys_read depend on sys_select to do the blocking. I also made sys_select handle NULL as the timeout (so that sys_read could block forever) Third, I didn't use signals, but instead sent the quit_char as an input_event to kbd_buffer_store_event. This seemed like a better idea than directly using signals because things like last_event_timestamp are updated. I left the call to mac_check_for_quit_char in Feval with a note in the cvs log that it might be removed. I tried to run some profiling tests but none of the data I got seemed useful. It seems to not be that expensive a call. In any case I filed a couple radar bugs to see if the WindowManager could be programmed to send a signal based on a hotkey. It's bug 3121160 (Allow ability to have a keypress cause a signal in Carbon). I also reported a bug to be able to set the main event queue for an application to be a secondary thread, but doubt that it will go anywhere due to thread safety issues. -Steven