diff options
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/src/keymap.c b/src/keymap.c index fbdd31e0de3..922c1703edf 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | /* Manipulation of keymaps | 1 | /* Manipulation of keymaps |
| 2 | Copyright (C) 1985-1988, 1993-1995, 1998-2012 Free Software Foundation, Inc. | 2 | Copyright (C) 1985-1988, 1993-1995, 1998-2013 Free Software |
| 3 | Foundation, Inc. | ||
| 3 | 4 | ||
| 4 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| 5 | 6 | ||
| @@ -564,15 +565,13 @@ map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val) | |||
| 564 | { | 565 | { |
| 565 | if (!NILP (val)) | 566 | if (!NILP (val)) |
| 566 | { | 567 | { |
| 567 | map_keymap_function_t fun | 568 | map_keymap_function_t fun = XSAVE_POINTER (args, 0); |
| 568 | = (map_keymap_function_t) XSAVE_VALUE (XCAR (args))->pointer; | ||
| 569 | args = XCDR (args); | ||
| 570 | /* If the key is a range, make a copy since map_char_table modifies | 569 | /* If the key is a range, make a copy since map_char_table modifies |
| 571 | it in place. */ | 570 | it in place. */ |
| 572 | if (CONSP (key)) | 571 | if (CONSP (key)) |
| 573 | key = Fcons (XCAR (key), XCDR (key)); | 572 | key = Fcons (XCAR (key), XCDR (key)); |
| 574 | map_keymap_item (fun, XCDR (args), key, val, | 573 | map_keymap_item (fun, XSAVE_OBJECT (args, 2), key, |
| 575 | XSAVE_VALUE (XCAR (args))->pointer); | 574 | val, XSAVE_POINTER (args, 1)); |
| 576 | } | 575 | } |
| 577 | } | 576 | } |
| 578 | 577 | ||
| @@ -610,12 +609,8 @@ map_keymap_internal (Lisp_Object map, | |||
| 610 | } | 609 | } |
| 611 | } | 610 | } |
| 612 | else if (CHAR_TABLE_P (binding)) | 611 | else if (CHAR_TABLE_P (binding)) |
| 613 | { | 612 | map_char_table (map_keymap_char_table_item, Qnil, binding, |
| 614 | map_char_table (map_keymap_char_table_item, Qnil, binding, | 613 | make_save_value ("ppo", fun, data, args)); |
| 615 | Fcons (make_save_value ((void *) fun, 0), | ||
| 616 | Fcons (make_save_value (data, 0), | ||
| 617 | args))); | ||
| 618 | } | ||
| 619 | } | 614 | } |
| 620 | UNGCPRO; | 615 | UNGCPRO; |
| 621 | return tail; | 616 | return tail; |
| @@ -1249,7 +1244,7 @@ remapping in all currently active keymaps. */) | |||
| 1249 | return INTEGERP (command) ? Qnil : command; | 1244 | return INTEGERP (command) ? Qnil : command; |
| 1250 | } | 1245 | } |
| 1251 | 1246 | ||
| 1252 | /* Value is number if KEY is too long; nil if valid but has no definition. */ | 1247 | /* Value is number if KEY is too long; nil if valid but has no definition. */ |
| 1253 | /* GC is possible in this function. */ | 1248 | /* GC is possible in this function. */ |
| 1254 | 1249 | ||
| 1255 | DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0, | 1250 | DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0, |
| @@ -1541,7 +1536,7 @@ DEFUN ("current-active-maps", Fcurrent_active_maps, Scurrent_active_maps, | |||
| 1541 | doc: /* Return a list of the currently active keymaps. | 1536 | doc: /* Return a list of the currently active keymaps. |
| 1542 | OLP if non-nil indicates that we should obey `overriding-local-map' and | 1537 | OLP if non-nil indicates that we should obey `overriding-local-map' and |
| 1543 | `overriding-terminal-local-map'. POSITION can specify a click position | 1538 | `overriding-terminal-local-map'. POSITION can specify a click position |
| 1544 | like in the respective argument of `key-binding'. */) | 1539 | like in the respective argument of `key-binding'. */) |
| 1545 | (Lisp_Object olp, Lisp_Object position) | 1540 | (Lisp_Object olp, Lisp_Object position) |
| 1546 | { | 1541 | { |
| 1547 | ptrdiff_t count = SPECPDL_INDEX (); | 1542 | ptrdiff_t count = SPECPDL_INDEX (); |
| @@ -1550,7 +1545,7 @@ like in the respective argument of `key-binding'. */) | |||
| 1550 | 1545 | ||
| 1551 | /* If a mouse click position is given, our variables are based on | 1546 | /* If a mouse click position is given, our variables are based on |
| 1552 | the buffer clicked on, not the current buffer. So we may have to | 1547 | the buffer clicked on, not the current buffer. So we may have to |
| 1553 | switch the buffer here. */ | 1548 | switch the buffer here. */ |
| 1554 | 1549 | ||
| 1555 | if (CONSP (position)) | 1550 | if (CONSP (position)) |
| 1556 | { | 1551 | { |
| @@ -2047,7 +2042,7 @@ DEFUN ("key-description", Fkey_description, Skey_description, 1, 2, 0, | |||
| 2047 | Optional arg PREFIX is the sequence of keys leading up to KEYS. | 2042 | Optional arg PREFIX is the sequence of keys leading up to KEYS. |
| 2048 | For example, [?\C-x ?l] is converted into the string \"C-x l\". | 2043 | For example, [?\C-x ?l] is converted into the string \"C-x l\". |
| 2049 | 2044 | ||
| 2050 | The `kbd' macro is an approximate inverse of this. */) | 2045 | For an approximate inverse of this, see `kbd'. */) |
| 2051 | (Lisp_Object keys, Lisp_Object prefix) | 2046 | (Lisp_Object keys, Lisp_Object prefix) |
| 2052 | { | 2047 | { |
| 2053 | ptrdiff_t len = 0; | 2048 | ptrdiff_t len = 0; |