aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 2b77a7fc444..53e231dd565 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -50,7 +50,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
50#include "keyboard.h" 50#include "keyboard.h"
51#include "termhooks.h" 51#include "termhooks.h"
52#include "blockinput.h" 52#include "blockinput.h"
53#include "puresize.h"
54#include "intervals.h" 53#include "intervals.h"
55#include "keymap.h" 54#include "keymap.h"
56#include "window.h" 55#include "window.h"
@@ -121,8 +120,6 @@ in case you use it as a menu with `x-popup-menu'. */)
121{ 120{
122 if (!NILP (string)) 121 if (!NILP (string))
123 { 122 {
124 if (!NILP (Vpurify_flag))
125 string = Fpurecopy (string);
126 return list2 (Qkeymap, string); 123 return list2 (Qkeymap, string);
127 } 124 }
128 return list1 (Qkeymap); 125 return list1 (Qkeymap);
@@ -301,7 +298,6 @@ Return PARENT. PARENT should be nil or another keymap. */)
301 If we came to the end, add the parent in PREV. */ 298 If we came to the end, add the parent in PREV. */
302 if (!CONSP (list) || KEYMAPP (list)) 299 if (!CONSP (list) || KEYMAPP (list))
303 { 300 {
304 CHECK_IMPURE (prev, XCONS (prev));
305 XSETCDR (prev, parent); 301 XSETCDR (prev, parent);
306 return parent; 302 return parent;
307 } 303 }
@@ -744,7 +740,7 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx,
744 740
745 /* If we are preparing to dump, and DEF is a menu element 741 /* If we are preparing to dump, and DEF is a menu element
746 with a menu item indicator, copy it to ensure it is not pure. */ 742 with a menu item indicator, copy it to ensure it is not pure. */
747 if (CONSP (def) && PURE_P (XCONS (def)) 743 if (CONSP (def)
748 && (EQ (XCAR (def), Qmenu_item) || STRINGP (XCAR (def)))) 744 && (EQ (XCAR (def), Qmenu_item) || STRINGP (XCAR (def))))
749 def = Fcons (XCAR (def), XCDR (def)); 745 def = Fcons (XCAR (def), XCDR (def));
750 746
@@ -788,7 +784,6 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx,
788 { 784 {
789 if (FIXNATP (idx) && XFIXNAT (idx) < ASIZE (elt)) 785 if (FIXNATP (idx) && XFIXNAT (idx) < ASIZE (elt))
790 { 786 {
791 CHECK_IMPURE (elt, XVECTOR (elt));
792 ASET (elt, XFIXNAT (idx), def); 787 ASET (elt, XFIXNAT (idx), def);
793 return def; 788 return def;
794 } 789 }
@@ -846,13 +841,12 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx,
846 } 841 }
847 else if (EQ (idx, XCAR (elt))) 842 else if (EQ (idx, XCAR (elt)))
848 { 843 {
849 CHECK_IMPURE (elt, XCONS (elt)); 844 XSETCDR (elt, def);
850 if (remove) 845 if (remove)
851 /* Remove the element. */ 846 /* Remove the element. */
852 insertion_point = Fdelq (elt, insertion_point); 847 insertion_point = Fdelq (elt, insertion_point);
853 else 848 else
854 /* Just set the definition. */ 849 /* Just set the definition. */
855 XSETCDR (elt, def);
856 return def; 850 return def;
857 } 851 }
858 else if (CONSP (idx) 852 else if (CONSP (idx)
@@ -900,7 +894,6 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx,
900 } 894 }
901 else 895 else
902 elt = Fcons (idx, def); 896 elt = Fcons (idx, def);
903 CHECK_IMPURE (insertion_point, XCONS (insertion_point));
904 XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point))); 897 XSETCDR (insertion_point, Fcons (elt, XCDR (insertion_point)));
905 } 898 }
906 } 899 }
@@ -3340,12 +3333,12 @@ syms_of_keymap (void)
3340 current_global_map = Qnil; 3333 current_global_map = Qnil;
3341 staticpro (&current_global_map); 3334 staticpro (&current_global_map);
3342 3335
3343 exclude_keys = pure_list 3336 exclude_keys = list
3344 (pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")), 3337 (Fcons (build_string ("DEL"), build_string ("\\d")),
3345 pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")), 3338 Fcons (build_string ("TAB"), build_string ("\\t")),
3346 pure_cons (build_pure_c_string ("RET"), build_pure_c_string ("\\r")), 3339 Fcons (build_string ("RET"), build_string ("\\r")),
3347 pure_cons (build_pure_c_string ("ESC"), build_pure_c_string ("\\e")), 3340 Fcons (build_string ("ESC"), build_string ("\\e")),
3348 pure_cons (build_pure_c_string ("SPC"), build_pure_c_string (" "))); 3341 Fcons (build_string ("SPC"), build_string (" ")));
3349 staticpro (&exclude_keys); 3342 staticpro (&exclude_keys);
3350 3343
3351 DEFVAR_LISP ("minibuffer-local-map", Vminibuffer_local_map, 3344 DEFVAR_LISP ("minibuffer-local-map", Vminibuffer_local_map,
@@ -3407,13 +3400,12 @@ that describe key bindings. That is why the default is nil. */);
3407 DEFSYM (Qmode_line, "mode-line"); 3400 DEFSYM (Qmode_line, "mode-line");
3408 3401
3409 staticpro (&Vmouse_events); 3402 staticpro (&Vmouse_events);
3410 Vmouse_events = pure_list (Qmenu_bar, Qtab_bar, Qtool_bar, 3403 Vmouse_events = list (Qmenu_bar, Qtool_bar, Qheader_line, Qmode_line,
3411 Qtab_line, Qheader_line, Qmode_line, 3404 intern_c_string ("mouse-1"),
3412 intern_c_string ("mouse-1"), 3405 intern_c_string ("mouse-2"),
3413 intern_c_string ("mouse-2"), 3406 intern_c_string ("mouse-3"),
3414 intern_c_string ("mouse-3"), 3407 intern_c_string ("mouse-4"),
3415 intern_c_string ("mouse-4"), 3408 intern_c_string ("mouse-5"));
3416 intern_c_string ("mouse-5"));
3417 3409
3418 /* Keymap used for minibuffers when doing completion. */ 3410 /* Keymap used for minibuffers when doing completion. */
3419 /* Keymap used for minibuffers when doing completion and require a match. */ 3411 /* Keymap used for minibuffers when doing completion and require a match. */