Mercurial > hg > xemacs-beta
comparison src/extents.c @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | 8626e4521993 |
children | a86b2b5e0111 |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
258 int numels; | 258 int numels; |
259 int elsize; | 259 int elsize; |
260 Gap_Array_Marker *markers; | 260 Gap_Array_Marker *markers; |
261 } Gap_Array; | 261 } Gap_Array; |
262 | 262 |
263 Gap_Array_Marker *gap_array_marker_freelist; | 263 static Gap_Array_Marker *gap_array_marker_freelist; |
264 | 264 |
265 /* Convert a "memory position" (i.e. taking the gap into account) into | 265 /* Convert a "memory position" (i.e. taking the gap into account) into |
266 the address of the element at (i.e. after) that position. "Memory | 266 the address of the element at (i.e. after) that position. "Memory |
267 positions" are only used internally and are of type Memind. | 267 positions" are only used internally and are of type Memind. |
268 "Array positions" are used externally and are of type int. */ | 268 "Array positions" are used externally and are of type int. */ |
299 Gap_Array *start; | 299 Gap_Array *start; |
300 Gap_Array *end; | 300 Gap_Array *end; |
301 Extent_List_Marker *markers; | 301 Extent_List_Marker *markers; |
302 } Extent_List; | 302 } Extent_List; |
303 | 303 |
304 Extent_List_Marker *extent_list_marker_freelist; | 304 static Extent_List_Marker *extent_list_marker_freelist; |
305 | 305 |
306 #define EXTENT_LESS_VALS(e,st,nd) ((extent_start (e) < (st)) || \ | 306 #define EXTENT_LESS_VALS(e,st,nd) ((extent_start (e) < (st)) || \ |
307 ((extent_start (e) == (st)) && \ | 307 ((extent_start (e) == (st)) && \ |
308 (extent_end (e) > (nd)))) | 308 (extent_end (e) > (nd)))) |
309 | 309 |
442 Lisp_Object Qoutside_margin; | 442 Lisp_Object Qoutside_margin; |
443 Lisp_Object Qinside_margin; | 443 Lisp_Object Qinside_margin; |
444 Lisp_Object Qwhitespace; | 444 Lisp_Object Qwhitespace; |
445 /* Qtext defined in general.c */ | 445 /* Qtext defined in general.c */ |
446 | 446 |
447 /* partially used in redisplay */ | |
448 Lisp_Object Qglyph_invisible; | |
449 | |
450 Lisp_Object Qcopy_function; | 447 Lisp_Object Qcopy_function; |
451 Lisp_Object Qpaste_function; | 448 Lisp_Object Qpaste_function; |
452 | 449 |
453 /* The idea here is that if we're given a list of faces, we | 450 /* The idea here is that if we're given a list of faces, we |
454 need to "memoize" this so that two lists of faces that are `equal' | 451 need to "memoize" this so that two lists of faces that are `equal' |
888 | 885 |
889 static Extent_List * | 886 static Extent_List * |
890 allocate_extent_list (void) | 887 allocate_extent_list (void) |
891 { | 888 { |
892 Extent_List *el = xnew (Extent_List); | 889 Extent_List *el = xnew (Extent_List); |
893 el->start = make_gap_array (sizeof(EXTENT)); | 890 el->start = make_gap_array (sizeof (EXTENT)); |
894 el->end = make_gap_array (sizeof(EXTENT)); | 891 el->end = make_gap_array (sizeof (EXTENT)); |
895 el->markers = 0; | 892 el->markers = 0; |
896 return el; | 893 return el; |
897 } | 894 } |
898 | 895 |
899 static void | 896 static void |
908 /************************************************************************/ | 905 /************************************************************************/ |
909 /* Auxiliary extent structure */ | 906 /* Auxiliary extent structure */ |
910 /************************************************************************/ | 907 /************************************************************************/ |
911 | 908 |
912 static Lisp_Object | 909 static Lisp_Object |
913 mark_extent_auxiliary (Lisp_Object obj, void (*markobj) (Lisp_Object)) | 910 mark_extent_auxiliary (Lisp_Object obj) |
914 { | 911 { |
915 struct extent_auxiliary *data = XEXTENT_AUXILIARY (obj); | 912 struct extent_auxiliary *data = XEXTENT_AUXILIARY (obj); |
916 markobj (data->begin_glyph); | 913 mark_object (data->begin_glyph); |
917 markobj (data->end_glyph); | 914 mark_object (data->end_glyph); |
918 markobj (data->invisible); | 915 mark_object (data->invisible); |
919 markobj (data->children); | 916 mark_object (data->children); |
920 markobj (data->read_only); | 917 mark_object (data->read_only); |
921 markobj (data->mouse_face); | 918 mark_object (data->mouse_face); |
922 markobj (data->initial_redisplay_function); | 919 mark_object (data->initial_redisplay_function); |
923 markobj (data->before_change_functions); | 920 mark_object (data->before_change_functions); |
924 markobj (data->after_change_functions); | 921 mark_object (data->after_change_functions); |
925 return data->parent; | 922 return data->parent; |
926 } | 923 } |
927 | 924 |
928 DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, | 925 DEFINE_LRECORD_IMPLEMENTATION ("extent-auxiliary", extent_auxiliary, |
929 mark_extent_auxiliary, internal_object_printer, | 926 mark_extent_auxiliary, internal_object_printer, |
930 0, 0, 0, struct extent_auxiliary); | 927 0, 0, 0, 0, struct extent_auxiliary); |
931 | 928 |
932 void | 929 void |
933 allocate_extent_auxiliary (EXTENT ext) | 930 allocate_extent_auxiliary (EXTENT ext) |
934 { | 931 { |
935 Lisp_Object extent_aux; | 932 Lisp_Object extent_aux; |
936 struct extent_auxiliary *data = | 933 struct extent_auxiliary *data = |
937 alloc_lcrecord_type (struct extent_auxiliary, lrecord_extent_auxiliary); | 934 alloc_lcrecord_type (struct extent_auxiliary, &lrecord_extent_auxiliary); |
938 | 935 |
939 copy_lcrecord (data, &extent_auxiliary_defaults); | 936 copy_lcrecord (data, &extent_auxiliary_defaults); |
940 XSETEXTENT_AUXILIARY (extent_aux, data); | 937 XSETEXTENT_AUXILIARY (extent_aux, data); |
941 ext->plist = Fcons (extent_aux, ext->plist); | 938 ext->plist = Fcons (extent_aux, ext->plist); |
942 ext->flags.has_aux = 1; | 939 ext->flags.has_aux = 1; |
971 static struct stack_of_extents *allocate_soe (void); | 968 static struct stack_of_extents *allocate_soe (void); |
972 static void free_soe (struct stack_of_extents *soe); | 969 static void free_soe (struct stack_of_extents *soe); |
973 static void soe_invalidate (Lisp_Object obj); | 970 static void soe_invalidate (Lisp_Object obj); |
974 | 971 |
975 static Lisp_Object | 972 static Lisp_Object |
976 mark_extent_info (Lisp_Object obj, void (*markobj) (Lisp_Object)) | 973 mark_extent_info (Lisp_Object obj) |
977 { | 974 { |
978 struct extent_info *data = (struct extent_info *) XEXTENT_INFO (obj); | 975 struct extent_info *data = (struct extent_info *) XEXTENT_INFO (obj); |
979 int i; | 976 int i; |
980 Extent_List *list = data->extents; | 977 Extent_List *list = data->extents; |
981 | 978 |
994 { | 991 { |
995 struct extent *extent = extent_list_at (list, i, 0); | 992 struct extent *extent = extent_list_at (list, i, 0); |
996 Lisp_Object exobj; | 993 Lisp_Object exobj; |
997 | 994 |
998 XSETEXTENT (exobj, extent); | 995 XSETEXTENT (exobj, extent); |
999 markobj (exobj); | 996 mark_object (exobj); |
1000 } | 997 } |
1001 } | 998 } |
1002 | 999 |
1003 return Qnil; | 1000 return Qnil; |
1004 } | 1001 } |
1023 } | 1020 } |
1024 } | 1021 } |
1025 | 1022 |
1026 DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, | 1023 DEFINE_LRECORD_IMPLEMENTATION ("extent-info", extent_info, |
1027 mark_extent_info, internal_object_printer, | 1024 mark_extent_info, internal_object_printer, |
1028 finalize_extent_info, 0, 0, | 1025 finalize_extent_info, 0, 0, 0, |
1029 struct extent_info); | 1026 struct extent_info); |
1030 | 1027 |
1031 static Lisp_Object | 1028 static Lisp_Object |
1032 allocate_extent_info (void) | 1029 allocate_extent_info (void) |
1033 { | 1030 { |
1034 Lisp_Object extent_info; | 1031 Lisp_Object extent_info; |
1035 struct extent_info *data = | 1032 struct extent_info *data = |
1036 alloc_lcrecord_type (struct extent_info, lrecord_extent_info); | 1033 alloc_lcrecord_type (struct extent_info, &lrecord_extent_info); |
1037 | 1034 |
1038 XSETEXTENT_INFO (extent_info, data); | 1035 XSETEXTENT_INFO (extent_info, data); |
1039 data->extents = allocate_extent_list (); | 1036 data->extents = allocate_extent_list (); |
1040 data->soe = 0; | 1037 data->soe = 0; |
1041 return extent_info; | 1038 return extent_info; |
2600 Dynarr_free (ef->begin_glyphs); | 2597 Dynarr_free (ef->begin_glyphs); |
2601 Dynarr_free (ef->end_glyphs); | 2598 Dynarr_free (ef->end_glyphs); |
2602 xfree (ef); | 2599 xfree (ef); |
2603 } | 2600 } |
2604 | 2601 |
2605 /* Note: CONST is losing, but `const' is part of the interface of qsort() */ | |
2606 static int | 2602 static int |
2607 extent_priority_sort_function (const void *humpty, const void *dumpty) | 2603 extent_priority_sort_function (const void *humpty, const void *dumpty) |
2608 { | 2604 { |
2609 CONST EXTENT foo = * (CONST EXTENT *) humpty; | 2605 const EXTENT foo = * (const EXTENT *) humpty; |
2610 CONST EXTENT bar = * (CONST EXTENT *) dumpty; | 2606 const EXTENT bar = * (const EXTENT *) dumpty; |
2611 if (extent_priority (foo) < extent_priority (bar)) | 2607 if (extent_priority (foo) < extent_priority (bar)) |
2612 return -1; | 2608 return -1; |
2613 return extent_priority (foo) > extent_priority (bar); | 2609 return extent_priority (foo) > extent_priority (bar); |
2614 } | 2610 } |
2615 | 2611 |
2911 | 2907 |
2912 /* These are the basic helper functions for handling the allocation of | 2908 /* These are the basic helper functions for handling the allocation of |
2913 extent objects. They are similar to the functions for other | 2909 extent objects. They are similar to the functions for other |
2914 lrecord objects. allocate_extent() is in alloc.c, not here. */ | 2910 lrecord objects. allocate_extent() is in alloc.c, not here. */ |
2915 | 2911 |
2916 static Lisp_Object mark_extent (Lisp_Object, void (*) (Lisp_Object)); | |
2917 static int extent_equal (Lisp_Object, Lisp_Object, int depth); | |
2918 static unsigned long extent_hash (Lisp_Object obj, int depth); | |
2919 static void print_extent (Lisp_Object obj, Lisp_Object printcharfun, | |
2920 int escapeflag); | |
2921 static Lisp_Object extent_getprop (Lisp_Object obj, Lisp_Object prop); | |
2922 static int extent_putprop (Lisp_Object obj, Lisp_Object prop, | |
2923 Lisp_Object value); | |
2924 static int extent_remprop (Lisp_Object obj, Lisp_Object prop); | |
2925 static Lisp_Object extent_plist (Lisp_Object obj); | |
2926 | |
2927 DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("extent", extent, | |
2928 mark_extent, | |
2929 print_extent, | |
2930 /* NOTE: If you declare a | |
2931 finalization method here, | |
2932 it will NOT be called. | |
2933 Shaft city. */ | |
2934 0, | |
2935 extent_equal, extent_hash, | |
2936 extent_getprop, extent_putprop, | |
2937 extent_remprop, extent_plist, | |
2938 struct extent); | |
2939 | |
2940 static Lisp_Object | 2912 static Lisp_Object |
2941 mark_extent (Lisp_Object obj, void (*markobj) (Lisp_Object)) | 2913 mark_extent (Lisp_Object obj) |
2942 { | 2914 { |
2943 struct extent *extent = XEXTENT (obj); | 2915 struct extent *extent = XEXTENT (obj); |
2944 | 2916 |
2945 markobj (extent_object (extent)); | 2917 mark_object (extent_object (extent)); |
2946 markobj (extent_no_chase_normal_field (extent, face)); | 2918 mark_object (extent_no_chase_normal_field (extent, face)); |
2947 return extent->plist; | 2919 return extent->plist; |
2948 } | 2920 } |
2949 | 2921 |
2950 static void | 2922 static void |
2951 print_extent_1 (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 2923 print_extent_1 (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
2960 if (!NILP (extent_begin_glyph (anc))) *bp++ = '*'; | 2932 if (!NILP (extent_begin_glyph (anc))) *bp++ = '*'; |
2961 *bp++ = (extent_start_open_p (anc) ? '(': '['); | 2933 *bp++ = (extent_start_open_p (anc) ? '(': '['); |
2962 if (extent_detached_p (ext)) | 2934 if (extent_detached_p (ext)) |
2963 strcpy (bp, "detached"); | 2935 strcpy (bp, "detached"); |
2964 else | 2936 else |
2965 { | 2937 sprintf (bp, "%ld, %ld", |
2966 Bufpos from = XINT (Fextent_start_position (obj)); | 2938 (long) XINT (Fextent_start_position (obj)), |
2967 Bufpos to = XINT (Fextent_end_position (obj)); | 2939 (long) XINT (Fextent_end_position (obj))); |
2968 sprintf (bp, "%d, %d", from, to); | |
2969 } | |
2970 bp += strlen (bp); | 2940 bp += strlen (bp); |
2971 *bp++ = (extent_end_open_p (anc) ? ')': ']'); | 2941 *bp++ = (extent_end_open_p (anc) ? ')': ']'); |
2972 if (!NILP (extent_end_glyph (anc))) *bp++ = '*'; | 2942 if (!NILP (extent_end_glyph (anc))) *bp++ = '*'; |
2973 *bp++ = ' '; | 2943 *bp++ = ' '; |
2974 | 2944 |
3002 static void | 2972 static void |
3003 print_extent (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) | 2973 print_extent (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) |
3004 { | 2974 { |
3005 if (escapeflag) | 2975 if (escapeflag) |
3006 { | 2976 { |
3007 CONST char *title = ""; | 2977 const char *title = ""; |
3008 CONST char *name = ""; | 2978 const char *name = ""; |
3009 CONST char *posttitle = ""; | 2979 const char *posttitle = ""; |
3010 Lisp_Object obj2 = Qnil; | 2980 Lisp_Object obj2 = Qnil; |
3011 | 2981 |
3012 /* Destroyed extents have 't' in the object field, causing | 2982 /* Destroyed extents have 't' in the object field, causing |
3013 extent_object() to abort (maybe). */ | 2983 extent_object() to abort (maybe). */ |
3014 if (EXTENT_LIVE_P (XEXTENT (obj))) | 2984 if (EXTENT_LIVE_P (XEXTENT (obj))) |
3125 /* No need to hash all of the elements; that would take too long. | 3095 /* No need to hash all of the elements; that would take too long. |
3126 Just hash the most common ones. */ | 3096 Just hash the most common ones. */ |
3127 return HASH3 (extent_start (e), extent_end (e), | 3097 return HASH3 (extent_start (e), extent_end (e), |
3128 internal_hash (extent_object (e), depth + 1)); | 3098 internal_hash (extent_object (e), depth + 1)); |
3129 } | 3099 } |
3100 | |
3101 static const struct lrecord_description extent_description[] = { | |
3102 { XD_LISP_OBJECT, offsetof (struct extent, object) }, | |
3103 { XD_LISP_OBJECT, offsetof (struct extent, flags.face) }, | |
3104 { XD_LISP_OBJECT, offsetof (struct extent, plist) }, | |
3105 { XD_END } | |
3106 }; | |
3130 | 3107 |
3131 static Lisp_Object | 3108 static Lisp_Object |
3132 extent_getprop (Lisp_Object obj, Lisp_Object prop) | 3109 extent_getprop (Lisp_Object obj, Lisp_Object prop) |
3133 { | 3110 { |
3134 return Fextent_property (obj, prop, Qunbound); | 3111 return Fextent_property (obj, prop, Qunbound); |
3175 { | 3152 { |
3176 /* #### Is this correct, anyway? */ | 3153 /* #### Is this correct, anyway? */ |
3177 return -1; | 3154 return -1; |
3178 } | 3155 } |
3179 | 3156 |
3180 return external_remprop (&ext->plist, prop, 0, ERROR_ME); | 3157 return external_remprop (extent_plist_addr (ext), prop, 0, ERROR_ME); |
3181 } | 3158 } |
3182 | 3159 |
3183 static Lisp_Object | 3160 static Lisp_Object |
3184 extent_plist (Lisp_Object obj) | 3161 extent_plist (Lisp_Object obj) |
3185 { | 3162 { |
3186 return Fextent_properties (obj); | 3163 return Fextent_properties (obj); |
3187 } | 3164 } |
3165 | |
3166 DEFINE_BASIC_LRECORD_IMPLEMENTATION_WITH_PROPS ("extent", extent, | |
3167 mark_extent, | |
3168 print_extent, | |
3169 /* NOTE: If you declare a | |
3170 finalization method here, | |
3171 it will NOT be called. | |
3172 Shaft city. */ | |
3173 0, | |
3174 extent_equal, extent_hash, | |
3175 extent_description, | |
3176 extent_getprop, extent_putprop, | |
3177 extent_remprop, extent_plist, | |
3178 struct extent); | |
3188 | 3179 |
3189 | 3180 |
3190 /************************************************************************/ | 3181 /************************************************************************/ |
3191 /* basic extent accessors */ | 3182 /* basic extent accessors */ |
3192 /************************************************************************/ | 3183 /************************************************************************/ |
3665 /* also need to copy the aux struct. It won't work for | 3656 /* also need to copy the aux struct. It won't work for |
3666 this extent to share the same aux struct as the original | 3657 this extent to share the same aux struct as the original |
3667 one. */ | 3658 one. */ |
3668 struct extent_auxiliary *data = | 3659 struct extent_auxiliary *data = |
3669 alloc_lcrecord_type (struct extent_auxiliary, | 3660 alloc_lcrecord_type (struct extent_auxiliary, |
3670 lrecord_extent_auxiliary); | 3661 &lrecord_extent_auxiliary); |
3671 | 3662 |
3672 copy_lcrecord (data, XEXTENT_AUXILIARY (XCAR (original->plist))); | 3663 copy_lcrecord (data, XEXTENT_AUXILIARY (XCAR (original->plist))); |
3673 XSETEXTENT_AUXILIARY (XCAR (e->plist), data); | 3664 XSETEXTENT_AUXILIARY (XCAR (e->plist), data); |
3674 } | 3665 } |
3675 | 3666 |
4614 Bufpos start, end; | 4605 Bufpos start, end; |
4615 int afterp; | 4606 int afterp; |
4616 int speccount; | 4607 int speccount; |
4617 }; | 4608 }; |
4618 | 4609 |
4619 /* This juggling with the pointer to another file's global variable is | |
4620 kind of yucky. Perhaps I should just export the variable. */ | |
4621 static int *inside_change_hook_pointer; | |
4622 | |
4623 static Lisp_Object | 4610 static Lisp_Object |
4624 report_extent_modification_restore (Lisp_Object buffer) | 4611 report_extent_modification_restore (Lisp_Object buffer) |
4625 { | 4612 { |
4626 *inside_change_hook_pointer = 0; | |
4627 if (current_buffer != XBUFFER (buffer)) | 4613 if (current_buffer != XBUFFER (buffer)) |
4628 Fset_buffer (buffer); | 4614 Fset_buffer (buffer); |
4629 return Qnil; | 4615 return Qnil; |
4630 } | 4616 } |
4631 | 4617 |
4646 XSETINT (endobj, closure->end); | 4632 XSETINT (endobj, closure->end); |
4647 | 4633 |
4648 /* Now that we are sure to call elisp, set up an unwind-protect so | 4634 /* Now that we are sure to call elisp, set up an unwind-protect so |
4649 inside_change_hook gets restored in case we throw. Also record | 4635 inside_change_hook gets restored in case we throw. Also record |
4650 the current buffer, in case we change it. Do the recording only | 4636 the current buffer, in case we change it. Do the recording only |
4651 once. */ | 4637 once. |
4638 | |
4639 One confusing thing here is that our caller never actually calls | |
4640 unbind_to (closure.speccount, Qnil). This is because | |
4641 map_extents_bytind() unbinds before, and with a smaller | |
4642 speccount. The additional unbind_to() in | |
4643 report_extent_modification() would cause XEmacs to abort. */ | |
4652 if (closure->speccount == -1) | 4644 if (closure->speccount == -1) |
4653 { | 4645 { |
4654 closure->speccount = specpdl_depth (); | 4646 closure->speccount = specpdl_depth (); |
4655 record_unwind_protect (report_extent_modification_restore, | 4647 record_unwind_protect (report_extent_modification_restore, |
4656 Fcurrent_buffer ()); | 4648 Fcurrent_buffer ()); |
4662 Fset_buffer (closure->buffer); | 4654 Fset_buffer (closure->buffer); |
4663 | 4655 |
4664 /* #### It's a shame that we can't use any of the existing run_hook* | 4656 /* #### It's a shame that we can't use any of the existing run_hook* |
4665 functions here. This is so because all of them work with | 4657 functions here. This is so because all of them work with |
4666 symbols, to be able to retrieve default values of local hooks. | 4658 symbols, to be able to retrieve default values of local hooks. |
4667 <sigh> */ | 4659 <sigh> |
4660 | |
4661 #### Idea: we could set up a dummy symbol, and call the hook | |
4662 functions on *that*. */ | |
4668 | 4663 |
4669 if (!CONSP (hook) || EQ (XCAR (hook), Qlambda)) | 4664 if (!CONSP (hook) || EQ (XCAR (hook), Qlambda)) |
4670 call3 (hook, exobj, startobj, endobj); | 4665 call3 (hook, exobj, startobj, endobj); |
4671 else | 4666 else |
4672 { | 4667 { |
4673 Lisp_Object tail; | 4668 Lisp_Object tail; |
4674 EXTERNAL_LIST_LOOP (tail, hook) | 4669 EXTERNAL_LIST_LOOP (tail, hook) |
4670 /* #### Shouldn't this perform the same Fset_buffer() check as | |
4671 above? */ | |
4675 call3 (XCAR (tail), exobj, startobj, endobj); | 4672 call3 (XCAR (tail), exobj, startobj, endobj); |
4676 } | 4673 } |
4677 return 0; | 4674 return 0; |
4678 } | 4675 } |
4679 | 4676 |
4680 void | 4677 void |
4681 report_extent_modification (Lisp_Object buffer, Bufpos start, Bufpos end, | 4678 report_extent_modification (Lisp_Object buffer, Bufpos start, Bufpos end, |
4682 int *inside, int afterp) | 4679 int afterp) |
4683 { | 4680 { |
4684 struct report_extent_modification_closure closure; | 4681 struct report_extent_modification_closure closure; |
4685 | 4682 |
4686 closure.buffer = buffer; | 4683 closure.buffer = buffer; |
4687 closure.start = start; | 4684 closure.start = start; |
4688 closure.end = end; | 4685 closure.end = end; |
4689 closure.afterp = afterp; | 4686 closure.afterp = afterp; |
4690 closure.speccount = -1; | 4687 closure.speccount = -1; |
4691 | 4688 |
4692 inside_change_hook_pointer = inside; | |
4693 *inside = 1; | |
4694 | |
4695 map_extents (start, end, report_extent_modification_mapper, (void *)&closure, | 4689 map_extents (start, end, report_extent_modification_mapper, (void *)&closure, |
4696 buffer, NULL, ME_MIGHT_CALL_ELISP); | 4690 buffer, NULL, ME_MIGHT_CALL_ELISP); |
4697 | |
4698 if (closure.speccount == -1) | |
4699 *inside = 0; | |
4700 else | |
4701 { | |
4702 /* We mustn't unbind when closure.speccount != -1 because | |
4703 map_extents_bytind has already done that. */ | |
4704 assert (*inside == 0); | |
4705 } | |
4706 } | 4691 } |
4707 | 4692 |
4708 | 4693 |
4709 /************************************************************************/ | 4694 /************************************************************************/ |
4710 /* extent properties */ | 4695 /* extent properties */ |
5007 Lisp_Object layout_obj) | 4992 Lisp_Object layout_obj) |
5008 { | 4993 { |
5009 EXTENT extent = decode_extent (extent_obj, DE_MUST_HAVE_BUFFER); | 4994 EXTENT extent = decode_extent (extent_obj, DE_MUST_HAVE_BUFFER); |
5010 glyph_layout layout = symbol_to_glyph_layout (layout_obj); | 4995 glyph_layout layout = symbol_to_glyph_layout (layout_obj); |
5011 | 4996 |
5012 /* Make sure we've actually been given a glyph or it's nil (meaning | 4997 /* Make sure we've actually been given a valid glyph or it's nil |
5013 we're deleting a glyph from an extent). */ | 4998 (meaning we're deleting a glyph from an extent). */ |
5014 if (!NILP (glyph)) | 4999 if (!NILP (glyph)) |
5015 CHECK_GLYPH (glyph); | 5000 CHECK_BUFFER_GLYPH (glyph); |
5016 | 5001 |
5017 set_extent_glyph (extent, glyph, endp, layout); | 5002 set_extent_glyph (extent, glyph, endp, layout); |
5018 return glyph; | 5003 return glyph; |
5019 } | 5004 } |
5020 | 5005 |
6713 defsymbol (&Qoutside_margin, "outside-margin"); | 6698 defsymbol (&Qoutside_margin, "outside-margin"); |
6714 defsymbol (&Qinside_margin, "inside-margin"); | 6699 defsymbol (&Qinside_margin, "inside-margin"); |
6715 defsymbol (&Qwhitespace, "whitespace"); | 6700 defsymbol (&Qwhitespace, "whitespace"); |
6716 /* Qtext defined in general.c */ | 6701 /* Qtext defined in general.c */ |
6717 | 6702 |
6718 defsymbol (&Qglyph_invisible, "glyph-invisible"); | |
6719 | |
6720 defsymbol (&Qpaste_function, "paste-function"); | 6703 defsymbol (&Qpaste_function, "paste-function"); |
6721 defsymbol (&Qcopy_function, "copy-function"); | 6704 defsymbol (&Qcopy_function, "copy-function"); |
6722 | 6705 |
6723 defsymbol (&Qtext_prop, "text-prop"); | 6706 defsymbol (&Qtext_prop, "text-prop"); |
6724 defsymbol (&Qtext_prop_extent_paste_function, | 6707 defsymbol (&Qtext_prop_extent_paste_function, |
6791 DEFSUBR (Fnext_single_property_change); | 6774 DEFSUBR (Fnext_single_property_change); |
6792 DEFSUBR (Fprevious_single_property_change); | 6775 DEFSUBR (Fprevious_single_property_change); |
6793 } | 6776 } |
6794 | 6777 |
6795 void | 6778 void |
6779 reinit_vars_of_extents (void) | |
6780 { | |
6781 extent_auxiliary_defaults.begin_glyph = Qnil; | |
6782 extent_auxiliary_defaults.end_glyph = Qnil; | |
6783 extent_auxiliary_defaults.parent = Qnil; | |
6784 extent_auxiliary_defaults.children = Qnil; | |
6785 extent_auxiliary_defaults.priority = 0; | |
6786 extent_auxiliary_defaults.invisible = Qnil; | |
6787 extent_auxiliary_defaults.read_only = Qnil; | |
6788 extent_auxiliary_defaults.mouse_face = Qnil; | |
6789 extent_auxiliary_defaults.initial_redisplay_function = Qnil; | |
6790 extent_auxiliary_defaults.before_change_functions = Qnil; | |
6791 extent_auxiliary_defaults.after_change_functions = Qnil; | |
6792 } | |
6793 | |
6794 void | |
6796 vars_of_extents (void) | 6795 vars_of_extents (void) |
6797 { | 6796 { |
6797 reinit_vars_of_extents (); | |
6798 | |
6798 DEFVAR_INT ("mouse-highlight-priority", &mouse_highlight_priority /* | 6799 DEFVAR_INT ("mouse-highlight-priority", &mouse_highlight_priority /* |
6799 The priority to use for the mouse-highlighting pseudo-extent | 6800 The priority to use for the mouse-highlighting pseudo-extent |
6800 that is used to highlight extents with the `mouse-face' attribute set. | 6801 that is used to highlight extents with the `mouse-face' attribute set. |
6801 See `set-extent-priority'. | 6802 See `set-extent-priority'. |
6802 */ ); | 6803 */ ); |
6819 staticpro (&Vlast_highlighted_extent); | 6820 staticpro (&Vlast_highlighted_extent); |
6820 Vlast_highlighted_extent = Qnil; | 6821 Vlast_highlighted_extent = Qnil; |
6821 | 6822 |
6822 Vextent_face_reusable_list = Fcons (Qnil, Qnil); | 6823 Vextent_face_reusable_list = Fcons (Qnil, Qnil); |
6823 staticpro (&Vextent_face_reusable_list); | 6824 staticpro (&Vextent_face_reusable_list); |
6824 | |
6825 extent_auxiliary_defaults.begin_glyph = Qnil; | |
6826 extent_auxiliary_defaults.end_glyph = Qnil; | |
6827 extent_auxiliary_defaults.parent = Qnil; | |
6828 extent_auxiliary_defaults.children = Qnil; | |
6829 extent_auxiliary_defaults.priority = 0; | |
6830 extent_auxiliary_defaults.invisible = Qnil; | |
6831 extent_auxiliary_defaults.read_only = Qnil; | |
6832 extent_auxiliary_defaults.mouse_face = Qnil; | |
6833 extent_auxiliary_defaults.initial_redisplay_function = Qnil; | |
6834 extent_auxiliary_defaults.before_change_functions = Qnil; | |
6835 extent_auxiliary_defaults.after_change_functions = Qnil; | |
6836 } | 6825 } |
6837 | 6826 |
6838 void | 6827 void |
6839 complex_vars_of_extents (void) | 6828 complex_vars_of_extents (void) |
6840 { | 6829 { |