comparison src/buffer.h @ 86285:59344cb482f3

* lisp.h (struct Lisp_Buffer_Objfwd): Add a `slottype' field. * data.c (store_symval_forwarding): Get type from buffer_objfwd. Update call to buffer_slot_type_mismatch. * buffer.h (buffer_local_types, PER_BUFFER_TYPE): Remove. (buffer_slot_type_mismatch): Update. * buffer.c (buffer_local_types): Remove. (buffer_slot_type_mismatch): Get the symbol and type as arguments. (defvar_per_buffer): Set the type in the buffer_objfwd.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 21 Nov 2007 20:59:47 +0000
parents e509314f0d59
children 107ccd98fa12 53108e6cea98
comparison
equal deleted inserted replaced
86284:d0c1a4ea2562 86285:59344cb482f3
816 /* For each buffer slot, this points to the Lisp symbol name 816 /* For each buffer slot, this points to the Lisp symbol name
817 for that slot in the current buffer. It is 0 for slots 817 for that slot in the current buffer. It is 0 for slots
818 that don't have such names. */ 818 that don't have such names. */
819 819
820 extern struct buffer buffer_local_symbols; 820 extern struct buffer buffer_local_symbols;
821
822 /* This structure holds the required types for the values in the
823 buffer-local slots. If a slot contains Qnil, then the
824 corresponding buffer slot may contain a value of any type. If a
825 slot contains an integer, then prospective values' tags must be
826 equal to that integer (except nil is always allowed).
827 When a tag does not match, the function
828 buffer_slot_type_mismatch will signal an error.
829
830 If a slot here contains -1, the corresponding variable is read-only. */
831
832 extern struct buffer buffer_local_types;
833 821
834 extern void delete_all_overlays P_ ((struct buffer *)); 822 extern void delete_all_overlays P_ ((struct buffer *));
835 extern void reset_buffer P_ ((struct buffer *)); 823 extern void reset_buffer P_ ((struct buffer *));
836 extern void evaporate_overlays P_ ((EMACS_INT)); 824 extern void evaporate_overlays P_ ((EMACS_INT));
837 extern int overlays_at P_ ((EMACS_INT, int, Lisp_Object **, int *, int *, int *, int)); 825 extern int overlays_at P_ ((EMACS_INT, int, Lisp_Object **, int *, int *, int *, int));
841 extern void validate_region P_ ((Lisp_Object *, Lisp_Object *)); 829 extern void validate_region P_ ((Lisp_Object *, Lisp_Object *));
842 extern void set_buffer_internal P_ ((struct buffer *)); 830 extern void set_buffer_internal P_ ((struct buffer *));
843 extern void set_buffer_internal_1 P_ ((struct buffer *)); 831 extern void set_buffer_internal_1 P_ ((struct buffer *));
844 extern void set_buffer_temp P_ ((struct buffer *)); 832 extern void set_buffer_temp P_ ((struct buffer *));
845 extern void record_buffer P_ ((Lisp_Object)); 833 extern void record_buffer P_ ((Lisp_Object));
846 extern void buffer_slot_type_mismatch P_ ((int)) NO_RETURN; 834 extern void buffer_slot_type_mismatch P_ ((Lisp_Object, int)) NO_RETURN;
847 extern void fix_overlays_before P_ ((struct buffer *, EMACS_INT, EMACS_INT)); 835 extern void fix_overlays_before P_ ((struct buffer *, EMACS_INT, EMACS_INT));
848 extern void mmap_set_vars P_ ((int)); 836 extern void mmap_set_vars P_ ((int));
849 837
850 /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. 838 /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements.
851 If NEXTP is non-NULL, return next overlay there. 839 If NEXTP is non-NULL, return next overlay there.
993 the buffer structure. */ 981 the buffer structure. */
994 982
995 #define PER_BUFFER_SYMBOL(OFFSET) \ 983 #define PER_BUFFER_SYMBOL(OFFSET) \
996 (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_symbols)) 984 (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_symbols))
997 985
998 /* Return the type of the per-buffer variable at offset OFFSET in the
999 buffer structure. */
1000
1001 #define PER_BUFFER_TYPE(OFFSET) \
1002 (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_types))
1003
1004 /* arch-tag: 679305dd-d41c-4a50-b170-3caf5c97b2d1 986 /* arch-tag: 679305dd-d41c-4a50-b170-3caf5c97b2d1
1005 (do not change this comment) */ 987 (do not change this comment) */