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: Strange behavior of C-u in the presence of sit-for in p-c-h Date: Thu, 19 Oct 2006 17:25:59 -0400 Message-ID: <87mz7s2e1k.fsf@stupidchicken.com> References: <87y7rfdmjg.fsf@furball.mit.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1161361037 24466 80.91.229.2 (20 Oct 2006 16:17:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 Oct 2006 16:17:17 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 20 18:17:14 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 1Gax35-0002nS-6r for ged-emacs-devel@m.gmane.org; Fri, 20 Oct 2006 18:16:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gax34-0002RW-Fr for ged-emacs-devel@m.gmane.org; Fri, 20 Oct 2006 12:16:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GafOj-0007QI-KZ for emacs-devel@gnu.org; Thu, 19 Oct 2006 17:25:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GafOf-0007Fb-1E for emacs-devel@gnu.org; Thu, 19 Oct 2006 17:25:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GafOe-0007FL-U1 for emacs-devel@gnu.org; Thu, 19 Oct 2006 17:25:48 -0400 Original-Received: from [18.19.1.138] (helo=cyd) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GafOa-0005TW-40; Thu, 19 Oct 2006 17:25:44 -0400 Original-Received: by cyd (Postfix, from userid 1000) id 55C194E443; Thu, 19 Oct 2006 17:25:59 -0400 (EDT) Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Thu\, 19 Oct 2006 23\:09\:28 +0200") 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:60933 Archived-At: storm@cua.dk (Kim F. Storm) writes: > Here is a simple patch which fixes the problem AFAICS. > > It uses a special event code (t . EVENT) in unread-command-events > to specify that EVENT is _not_ reread. Of course, this should be > documented in unread-command-events if people think this fix is ok. I think it's an excellent idea. > *** keyboard.c 10 Oct 2006 10:33:25 +0200 1.878 > --- keyboard.c 19 Oct 2006 23:00:23 +0200 > *************** > *** 2537,2542 **** > --- 2537,2554 ---- > c = XCAR (Vunread_command_events); > Vunread_command_events = XCDR (Vunread_command_events); > > + reread = 1; > + > + /* Undo what sit-for did when it unread additional keys > + inside universal-argument. */ > + > + if (CONSP (c) > + && EQ (XCAR (c), Qt)) > + { > + reread = 0; > + c = XCDR (c); > + } > + > /* Undo what read_char_x_menu_prompt did when it unread > additional keys returned by Fx_popup_menu. */ > if (CONSP (c) > *************** > *** 2550,2556 **** > && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar))) > *used_mouse_menu = 1; > > - reread = 1; > goto reread_for_input_method; > } > > --- 2562,2567 ---- > > > Index: subr.el > =================================================================== > RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v > retrieving revision 1.530 > diff -c -r1.530 subr.el > *** subr.el 18 Oct 2006 10:56:46 -0000 1.530 > --- subr.el 19 Oct 2006 21:08:24 -0000 > *************** > *** 1752,1759 **** > (or nodisp (redisplay)) > (let ((read (read-event nil nil seconds))) > (or (null read) > ! (progn (push read unread-command-events) > ! nil)))))) > > ;;; Atomic change groups. > > --- 1758,1768 ---- > (or nodisp (redisplay)) > (let ((read (read-event nil nil seconds))) > (or (null read) > ! (progn > ! (if (eq overriding-terminal-local-map universal-argument-map) > ! (setq read (cons t read))) > ! (push read unread-command-events) > ! nil)))))) > > ;;; Atomic change groups.