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: discrepancy between read-key-sequence and manual Date: Mon, 11 Sep 2006 15:58:11 -0400 Message-ID: References: <85lkoqh64k.fsf@lola.goethe.zz> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1158004964 10344 80.91.229.2 (11 Sep 2006 20:02:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Sep 2006 20:02:44 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 11 22:02:43 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 1GMrz9-0007sD-RB for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2006 22:02:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMrz9-0000l3-FX for ged-emacs-devel@m.gmane.org; Mon, 11 Sep 2006 16:02:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GMrv3-0005Uz-Je for emacs-devel@gnu.org; Mon, 11 Sep 2006 15:58:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GMrv3-0005UM-3m for emacs-devel@gnu.org; Mon, 11 Sep 2006 15:58:13 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GMrv2-0005Tz-IN for emacs-devel@gnu.org; Mon, 11 Sep 2006 15:58:12 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GMrwN-0006wO-CU for emacs-devel@gnu.org; Mon, 11 Sep 2006 15:59:35 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1GMrv1-0007te-G1; Mon, 11 Sep 2006 15:58:11 -0400 Original-To: David Kastrup In-reply-to: <85lkoqh64k.fsf@lola.goethe.zz> (message from David Kastrup on Mon, 11 Sep 2006 15:42:19 +0200) 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:59705 Archived-At: Lots of documentation says that overriding-terminal-local-map overrides overriding-local-map. So I think we should make the code fit all that documentation. In practice, overriding-local-map is not used very much, so there is not much chance for there to be code that depends on the current behavior. Does this patch do the job? *** keyboard.c 11 Sep 2006 10:33:19 -0400 1.875 --- keyboard.c 11 Sep 2006 15:44:41 -0400 *************** *** 8765,8781 **** the initial keymaps from the current buffer. */ nmaps = 0; ! if (!NILP (current_kboard->Voverriding_terminal_local_map) ! || !NILP (Voverriding_local_map)) { ! if (3 > nmaps_allocated) { ! submaps = (Lisp_Object *) alloca (3 * sizeof (submaps[0])); ! defs = (Lisp_Object *) alloca (3 * sizeof (defs[0])); ! nmaps_allocated = 3; } if (!NILP (current_kboard->Voverriding_terminal_local_map)) submaps[nmaps++] = current_kboard->Voverriding_terminal_local_map; if (!NILP (Voverriding_local_map)) submaps[nmaps++] = Voverriding_local_map; } --- 8765,8789 ---- the initial keymaps from the current buffer. */ nmaps = 0; ! if (!NILP (current_kboard->Voverriding_terminal_local_map)) { ! if (2 > nmaps_allocated) { ! submaps = (Lisp_Object *) alloca (2 * sizeof (submaps[0])); ! defs = (Lisp_Object *) alloca (2 * sizeof (defs[0])); ! nmaps_allocated = 2; } if (!NILP (current_kboard->Voverriding_terminal_local_map)) submaps[nmaps++] = current_kboard->Voverriding_terminal_local_map; + } + else if (!NILP (Voverriding_local_map)) + { + if (2 > nmaps_allocated) + { + submaps = (Lisp_Object *) alloca (2 * sizeof (submaps[0])); + defs = (Lisp_Object *) alloca (2 * sizeof (defs[0])); + nmaps_allocated = 2; + } if (!NILP (Voverriding_local_map)) submaps[nmaps++] = Voverriding_local_map; }