From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Cursor doesn't go back to after close-paren Date: Thu, 03 Aug 2006 16:14:43 -0400 Message-ID: <87r6zxmv9o.fsf@stupidchicken.com> References: <87bqr2gc7m.fsf@stupidchicken.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1154637340 1045 80.91.229.2 (3 Aug 2006 20:35:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 Aug 2006 20:35:40 +0000 (UTC) Cc: lekktu@gmail.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 03 22:35:36 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G8juY-000513-Gf for ged-emacs-devel@m.gmane.org; Thu, 03 Aug 2006 22:35:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G8juR-0000j3-QA for ged-emacs-devel@m.gmane.org; Thu, 03 Aug 2006 16:35:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G8jtv-0000Hd-DT for emacs-devel@gnu.org; Thu, 03 Aug 2006 16:34:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G8jtq-00009b-2i for emacs-devel@gnu.org; Thu, 03 Aug 2006 16:34:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G8jtp-00009N-TO for emacs-devel@gnu.org; Thu, 03 Aug 2006 16:34:33 -0400 Original-Received: from [18.19.1.138] (helo=cyd) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G8jxB-0005sl-0a; Thu, 03 Aug 2006 16:38:01 -0400 Original-Received: by cyd (Postfix, from userid 1000) id DFAEB4E890; Thu, 3 Aug 2006 16:14:43 -0400 (EDT) Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Thu, 03 Aug 2006 22:32:08 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:58066 Archived-At: Eli Zaretskii writes: > Can someone please describe in detail how the current sit-for is > supposed to work, in particular in the situation where it is called > from blink-matching-open? Please describe in detail the OS-related > machinery, if any (interrupts, signals, timers, etc.) which are > involved; I'd like to compare that with what happens on MS-Windows, to > find out why the cursor doesn't return on Windows. The sit-for mechanism no longer uses timers. It basically relies on (read-event nil nil seconds) The new SECONDS argument to `read-event', if non-nil, specifies a number of seconds to wait for input. If no input arrives within that time, it stops waiting and returns nil. That's probably what you first want to make sure is working. `read-event' works by passing a SECONDS argument to read_filtered_event, which computes the desired end time and passes that to read_char, which passes it to kbd_buffer_get_event, which loops calling wait_reading_process_output. During this loop, kbd_buffer_get_event tells wait_reading_process_output to wait the desired number of seconds (normally, when there is no SECONDS argument, it tells wait_reading_process_output to wait indefinitely). We break out of the kbd_buffer_get_event loop if the end time expires (in which case we return Qnil), or if wait_reading_process_output returns due to a valid input event. The old sit-for, in contrast, simply called wait_reading_process_output for the given number of seconds.