comparison src/buffer.c @ 95112:0835cb21d60e

* lisp.h (indirect_variable): * data.c (indirect_variable, let_shadows_buffer_binding_p): Use Lisp_Symbol pointers rather than Lisp_Object. Adjust callers. * buffer.c (buffer_slot_type_mismatch): Use wrong-type-argument. To this end, change calling-convention.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 19 May 2008 18:38:55 +0000
parents 8971ddf55736
children 9a4b27c8feec
comparison
equal deleted inserted replaced
95111:f3a094e70d91 95112:0835cb21d60e
925 register Lisp_Object variable; 925 register Lisp_Object variable;
926 register Lisp_Object buffer; 926 register Lisp_Object buffer;
927 { 927 {
928 register struct buffer *buf; 928 register struct buffer *buf;
929 register Lisp_Object result; 929 register Lisp_Object result;
930 struct Lisp_Symbol *sym;
930 931
931 CHECK_SYMBOL (variable); 932 CHECK_SYMBOL (variable);
932 CHECK_BUFFER (buffer); 933 CHECK_BUFFER (buffer);
933 buf = XBUFFER (buffer); 934 buf = XBUFFER (buffer);
934 935
935 variable = indirect_variable (variable); 936 sym = indirect_variable (XSYMBOL (variable));
937 XSETSYMBOL (variable, sym);
936 938
937 /* Look in local_var_list */ 939 /* Look in local_var_list */
938 result = Fassoc (variable, buf->local_var_alist); 940 result = Fassoc (variable, buf->local_var_alist);
939 if (NILP (result)) 941 if (NILP (result))
940 { 942 {
967 { 969 {
968 Lisp_Object valcontents; 970 Lisp_Object valcontents;
969 Lisp_Object current_alist_element; 971 Lisp_Object current_alist_element;
970 972
971 /* What binding is loaded right now? */ 973 /* What binding is loaded right now? */
972 valcontents = SYMBOL_VALUE (variable); 974 valcontents = sym->value;
973 current_alist_element 975 current_alist_element
974 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr); 976 = XCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr);
975 977
976 /* The value of the currently loaded binding is not 978 /* The value of the currently loaded binding is not
977 stored in it, but rather in the realvalue slot. 979 stored in it, but rather in the realvalue slot.
4548 4550
4549 /* Somebody has tried to store a value with an unacceptable type 4551 /* Somebody has tried to store a value with an unacceptable type
4550 in the slot with offset OFFSET. */ 4552 in the slot with offset OFFSET. */
4551 4553
4552 void 4554 void
4553 buffer_slot_type_mismatch (sym, type) 4555 buffer_slot_type_mismatch (newval, type)
4554 Lisp_Object sym; 4556 Lisp_Object newval;
4555 int type; 4557 int type;
4556 { 4558 {
4557 char *type_name; 4559 Lisp_Object predicate;
4558 4560
4559 switch (type) 4561 switch (type)
4560 { 4562 {
4561 case Lisp_Int: 4563 case Lisp_Int: predicate = Qintegerp; break;
4562 type_name = "integers"; 4564 case Lisp_String: predicate = Qstringp; break;
4563 break; 4565 case Lisp_Symbol: predicate = Qsymbolp; break;
4564 4566 default: abort ();
4565 case Lisp_String: 4567 }
4566 type_name = "strings"; 4568
4567 break; 4569 wrong_type_argument (predicate, newval);
4568
4569 case Lisp_Symbol:
4570 type_name = "symbols";
4571 break;
4572
4573 default:
4574 abort ();
4575 }
4576
4577 error ("Only %s should be stored in the buffer-local variable %s",
4578 type_name, SDATA (SYMBOL_NAME (sym)));
4579 } 4570 }
4580 4571
4581 4572
4582 /*********************************************************************** 4573 /***********************************************************************
4583 Allocation with mmap 4574 Allocation with mmap