[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cursor doesn't go back to after close-paren

From: Chong Yidong
Subject: Re: Cursor doesn't go back to after close-paren
Date: Thu, 03 Aug 2006 16:14:43 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]