aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorKen Raeburn2001-10-16 09:09:51 +0000
committerKen Raeburn2001-10-16 09:09:51 +0000
commitf3fbd1553534bb85c75baf891c0ca9aaa4c3fa6f (patch)
tree43eb51ff0ca4af1705387403827ef210098f2da8 /src/keymap.c
parent018ba359ab456f6a43f3acea0c15df616aa0ad02 (diff)
downloademacs-f3fbd1553534bb85c75baf891c0ca9aaa4c3fa6f.tar.gz
emacs-f3fbd1553534bb85c75baf891c0ca9aaa4c3fa6f.zip
Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
with lisp system changes.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 75a12ead3ca..eb4d3ab375c 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -363,7 +363,7 @@ PARENT should be nil or another keymap.")
363 if (EQ (XCDR (prev), parent)) 363 if (EQ (XCDR (prev), parent))
364 RETURN_UNGCPRO (parent); 364 RETURN_UNGCPRO (parent);
365 365
366 XCDR (prev) = parent; 366 XSETCDR (prev, parent);
367 break; 367 break;
368 } 368 }
369 prev = list; 369 prev = list;
@@ -769,7 +769,7 @@ store_in_keymap (keymap, idx, def)
769 { 769 {
770 if (EQ (idx, XCAR (elt))) 770 if (EQ (idx, XCAR (elt)))
771 { 771 {
772 XCDR (elt) = def; 772 XSETCDR (elt, def);
773 return def; 773 return def;
774 } 774 }
775 } 775 }
@@ -786,8 +786,8 @@ store_in_keymap (keymap, idx, def)
786 keymap_end: 786 keymap_end:
787 /* We have scanned the entire keymap, and not found a binding for 787 /* We have scanned the entire keymap, and not found a binding for
788 IDX. Let's add one. */ 788 IDX. Let's add one. */
789 XCDR (insertion_point) 789 XSETCDR (insertion_point,
790 = Fcons (Fcons (idx, def), XCDR (insertion_point)); 790 Fcons (Fcons (idx, def), XCDR (insertion_point)));
791 } 791 }
792 792
793 return def; 793 return def;
@@ -830,7 +830,7 @@ is not copied.")
830 Lisp_Object indices[3]; 830 Lisp_Object indices[3];
831 831
832 elt = Fcopy_sequence (elt); 832 elt = Fcopy_sequence (elt);
833 XCAR (tail) = elt; 833 XSETCAR (tail, elt);
834 834
835 map_char_table (copy_keymap_1, Qnil, elt, elt, 0, indices); 835 map_char_table (copy_keymap_1, Qnil, elt, elt, 0, indices);
836 } 836 }
@@ -839,7 +839,7 @@ is not copied.")
839 int i; 839 int i;
840 840
841 elt = Fcopy_sequence (elt); 841 elt = Fcopy_sequence (elt);
842 XCAR (tail) = elt; 842 XSETCAR (tail, elt);
843 843
844 for (i = 0; i < ASIZE (elt); i++) 844 for (i = 0; i < ASIZE (elt); i++)
845 if (CONSP (AREF (elt, i)) && EQ (XCAR (AREF (elt, i)), Qkeymap)) 845 if (CONSP (AREF (elt, i)) && EQ (XCAR (AREF (elt, i)), Qkeymap))
@@ -854,15 +854,15 @@ is not copied.")
854 if (EQ (XCAR (tem),Qmenu_item)) 854 if (EQ (XCAR (tem),Qmenu_item))
855 { 855 {
856 /* Copy cell with menu-item marker. */ 856 /* Copy cell with menu-item marker. */
857 XCDR (elt) 857 XSETCDR (elt,
858 = Fcons (XCAR (tem), XCDR (tem)); 858 Fcons (XCAR (tem), XCDR (tem)));
859 elt = XCDR (elt); 859 elt = XCDR (elt);
860 tem = XCDR (elt); 860 tem = XCDR (elt);
861 if (CONSP (tem)) 861 if (CONSP (tem))
862 { 862 {
863 /* Copy cell with menu-item name. */ 863 /* Copy cell with menu-item name. */
864 XCDR (elt) 864 XSETCDR (elt,
865 = Fcons (XCAR (tem), XCDR (tem)); 865 Fcons (XCAR (tem), XCDR (tem)));
866 elt = XCDR (elt); 866 elt = XCDR (elt);
867 tem = XCDR (elt); 867 tem = XCDR (elt);
868 }; 868 };
@@ -870,16 +870,16 @@ is not copied.")
870 { 870 {
871 /* Copy cell with binding and if the binding is a keymap, 871 /* Copy cell with binding and if the binding is a keymap,
872 copy that. */ 872 copy that. */
873 XCDR (elt) 873 XSETCDR (elt,
874 = Fcons (XCAR (tem), XCDR (tem)); 874 Fcons (XCAR (tem), XCDR (tem)));
875 elt = XCDR (elt); 875 elt = XCDR (elt);
876 tem = XCAR (elt); 876 tem = XCAR (elt);
877 if (CONSP (tem) && EQ (XCAR (tem), Qkeymap)) 877 if (CONSP (tem) && EQ (XCAR (tem), Qkeymap))
878 XCAR (elt) = Fcopy_keymap (tem); 878 XSETCAR (elt, Fcopy_keymap (tem));
879 tem = XCDR (elt); 879 tem = XCDR (elt);
880 if (CONSP (tem) && CONSP (XCAR (tem))) 880 if (CONSP (tem) && CONSP (XCAR (tem)))
881 /* Delete cache for key equivalences. */ 881 /* Delete cache for key equivalences. */
882 XCDR (elt) = XCDR (tem); 882 XSETCDR (elt, XCDR (tem));
883 } 883 }
884 } 884 }
885 else 885 else
@@ -890,15 +890,15 @@ is not copied.")
890 if (STRINGP (XCAR (tem))) 890 if (STRINGP (XCAR (tem)))
891 { 891 {
892 /* Copy the cell, since copy-alist didn't go this deep. */ 892 /* Copy the cell, since copy-alist didn't go this deep. */
893 XCDR (elt) 893 XSETCDR (elt,
894 = Fcons (XCAR (tem), XCDR (tem)); 894 Fcons (XCAR (tem), XCDR (tem)));
895 elt = XCDR (elt); 895 elt = XCDR (elt);
896 tem = XCDR (elt); 896 tem = XCDR (elt);
897 /* Also skip the optional menu help string. */ 897 /* Also skip the optional menu help string. */
898 if (CONSP (tem) && STRINGP (XCAR (tem))) 898 if (CONSP (tem) && STRINGP (XCAR (tem)))
899 { 899 {
900 XCDR (elt) 900 XSETCDR (elt,
901 = Fcons (XCAR (tem), XCDR (tem)); 901 Fcons (XCAR (tem), XCDR (tem)));
902 elt = XCDR (elt); 902 elt = XCDR (elt);
903 tem = XCDR (elt); 903 tem = XCDR (elt);
904 } 904 }
@@ -908,12 +908,12 @@ is not copied.")
908 && CONSP (XCAR (tem)) 908 && CONSP (XCAR (tem))
909 && (NILP (XCAR (XCAR (tem))) 909 && (NILP (XCAR (XCAR (tem)))
910 || VECTORP (XCAR (XCAR (tem))))) 910 || VECTORP (XCAR (XCAR (tem)))))
911 XCDR (elt) = XCDR (tem); 911 XSETCDR (elt, XCDR (tem));
912 } 912 }
913 if (CONSP (elt) 913 if (CONSP (elt)
914 && CONSP (XCDR (elt)) 914 && CONSP (XCDR (elt))
915 && EQ (XCAR (XCDR (elt)), Qkeymap)) 915 && EQ (XCAR (XCDR (elt)), Qkeymap))
916 XCDR (elt) = Fcopy_keymap (XCDR (elt)); 916 XSETCDR (elt, Fcopy_keymap (XCDR (elt)));
917 } 917 }
918 918
919 } 919 }
@@ -1548,8 +1548,8 @@ accessible_keymaps_1 (key, cmd, maps, tail, thisseq, is_metized)
1548 /* This new sequence is the same length as 1548 /* This new sequence is the same length as
1549 thisseq, so stick it in the list right 1549 thisseq, so stick it in the list right
1550 after this one. */ 1550 after this one. */
1551 XCDR (tail) 1551 XSETCDR (tail,
1552 = Fcons (Fcons (tem, cmd), XCDR (tail)); 1552 Fcons (Fcons (tem, cmd), XCDR (tail)));
1553 } 1553 }
1554 else 1554 else
1555 { 1555 {
@@ -2396,7 +2396,7 @@ where_is_internal_2 (args, key, binding)
2396 this, last, nomenus, last_is_meta); 2396 this, last, nomenus, last_is_meta);
2397 2397
2398 if (!NILP (sequence)) 2398 if (!NILP (sequence))
2399 XCDR (XCAR (args)) = Fcons (sequence, result); 2399 XSETCDR (XCAR (args), Fcons (sequence, result));
2400 2400
2401 UNGCPRO; 2401 UNGCPRO;
2402} 2402}