changeset 100689:eca026eee0d7

(map_keymap_char_table_item): Make a copy of KEY if it is a cons.
author Andreas Schwab <schwab@suse.de>
date Fri, 26 Dec 2008 14:43:21 +0000
parents 8233f3e2beb4
children bc724faa95e6
files src/ChangeLog src/keymap.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Dec 26 09:39:49 2008 +0000
+++ b/src/ChangeLog	Fri Dec 26 14:43:21 2008 +0000
@@ -1,3 +1,8 @@
+2008-12-26  Andreas Schwab  <schwab@suse.de>
+
+	* keymap.c (map_keymap_char_table_item): Make a copy of KEY if it is a
+	cons.
+
 2008-12-26  Martin Rudalics  <rudalics@gmx.at>
 
 	* textprop.c (Qminibuffer_prompt): New variable.
--- a/src/keymap.c	Fri Dec 26 09:39:49 2008 +0000
+++ b/src/keymap.c	Fri Dec 26 14:43:21 2008 +0000
@@ -650,6 +650,10 @@
     {
       map_keymap_function_t fun = XSAVE_VALUE (XCAR (args))->pointer;
       args = XCDR (args);
+      /* If the key is a range, make a copy since map_char_table modifies
+	 it in place.  */
+      if (CONSP (key))
+	key = Fcons (XCAR (key), XCDR (key));
       map_keymap_item (fun, XCDR (args), key, val,
 		       XSAVE_VALUE (XCAR (args))->pointer);
     }