From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: The order input events are processed. Date: Sun, 10 Sep 2006 09:05:04 -0400 Message-ID: References: <87odtrrkgh.fsf@lrde.org> <87ejukt7fe.fsf@lrde.org> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1157893606 7261 80.91.229.2 (10 Sep 2006 13:06:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 10 Sep 2006 13:06:46 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 10 15:06:45 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 1GMP1F-0004fm-Tq for ged-emacs-devel@m.gmane.org; Sun, 10 Sep 2006 15:06:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMP1F-0006JC-Hh for ged-emacs-devel@m.gmane.org; Sun, 10 Sep 2006 09:06:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GMOzk-0005nF-8Z for emacs-devel@gnu.org; Sun, 10 Sep 2006 09:05:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GMOzj-0005mw-Nb for emacs-devel@gnu.org; Sun, 10 Sep 2006 09:05:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMOzj-0005mq-JW for emacs-devel@gnu.org; Sun, 10 Sep 2006 09:05:07 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GMP0m-0001Le-9s for emacs-devel@gnu.org; Sun, 10 Sep 2006 09:06:12 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1GMOzg-0007mG-6L; Sun, 10 Sep 2006 09:05:04 -0400 Original-To: michael.cadilhac@lrde.org (=?iso-8859-1?Q?Micha=EBl?= Cadilhac) In-reply-to: <87ejukt7fe.fsf@lrde.org> (michael.cadilhac@lrde.org) 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:59625 Archived-At: > One way to fix it is for sit_for to test these variables directly > so that it doesn't need to change them. Does anyone see a problem > with that? Does it mean that sit-for will have to do active wait [1] ? I see no reason to think so. It just has to check these variables at the start. However, I've always dreamt about an unique entry point for unread-events: unread-command-events would store direct events (u-c-e =3D '(?a ?b)) or events as a cons, the cdr telling if input-method has to be used (u-c-e =3D '(?a (?b . nil) ?c)). Does it seems crazy? [2] It seems ugly and complex. Not as good as the present scheme. Here's the patch I have in mind. If input methods use sit-for, we might need to create a way to refrain from testing unread-post-input-method-events in that case. *** subr.el 27 Jul 2006 23:33:22 -0400 1.523 --- subr.el 10 Sep 2006 08:28:34 -0400 *************** *** 1730,1745 **** floating point support. \(fn SECONDS &optional NODISP)" ! (when (or obsolete (numberp nodisp)) ! (setq seconds (+ seconds (* 1e-3 nodisp))) ! (setq nodisp obsolete)) ! (if noninteractive ! (progn (sleep-for seconds) t) ! (unless nodisp (redisplay)) ! (or (<= seconds 0) ! (let ((read (read-event nil nil seconds))) ! (or (null read) ! (progn (push read unread-command-events) nil)))))) ;;; Atomic change groups. --- 1730,1749 ---- floating point support. \(fn SECONDS &optional NODISP)" ! (unless (or unread-command-events ! unread-post-input-method-events ! unread-input-method-events ! (>= unread-command-char 0)) ! (when (or obsolete (numberp nodisp)) ! (setq seconds (+ seconds (* 1e-3 nodisp))) ! (setq nodisp obsolete)) ! (if noninteractive ! (progn (sleep-for seconds) t) ! (unless nodisp (redisplay)) ! (or (<= seconds 0) ! (let ((read (read-event nil nil seconds))) ! (or (null read) ! (progn (push read unread-command-events) nil))))))) ;;; Atomic change groups.