Mercurial > hg > xemacs-beta
comparison src/extents.c @ 280:7df0dd720c89 r21-0b38
Import from CVS: tag r21-0b38
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:32:22 +0200 |
parents | 6330739388db |
children | 558f606b08ae |
comparison
equal
deleted
inserted
replaced
279:c20b2fb5bb0a | 280:7df0dd720c89 |
---|---|
4746 (memoize_extent_face_internal (value))); | 4746 (memoize_extent_face_internal (value))); |
4747 return value; | 4747 return value; |
4748 } | 4748 } |
4749 | 4749 |
4750 /* Do we need a lisp-level function ? */ | 4750 /* Do we need a lisp-level function ? */ |
4751 DEFUN ("set-extent-initial-redisplay-function", | 4751 DEFUN ("set-extent-initial-redisplay-function", Fset_extent_initial_redisplay_function, |
4752 Fset_extent_initial_redisplay_function, 2,2,0,/* | 4752 2,2,0,/* |
4753 Note: This feature is experimental! | 4753 Note: This feature is experimental! |
4754 | 4754 |
4755 Set initial-redisplay-function of EXTENT to the function | 4755 Set initial-redisplay-function of EXTENT to the function |
4756 FUNCTION. | 4756 FUNCTION. |
4757 | 4757 |
4982 Set this using the `set-extent-begin-glyph-layout' function. | 4982 Set this using the `set-extent-begin-glyph-layout' function. |
4983 */ | 4983 */ |
4984 (extent)) | 4984 (extent)) |
4985 { | 4985 { |
4986 EXTENT e = decode_extent (extent, 0); | 4986 EXTENT e = decode_extent (extent, 0); |
4987 return glyph_layout_to_symbol (extent_begin_glyph_layout (e)); | 4987 return glyph_layout_to_symbol ((glyph_layout) extent_begin_glyph_layout (e)); |
4988 } | 4988 } |
4989 | 4989 |
4990 DEFUN ("extent-end-glyph-layout", Fextent_end_glyph_layout, 1, 1, 0, /* | 4990 DEFUN ("extent-end-glyph-layout", Fextent_end_glyph_layout, 1, 1, 0, /* |
4991 Return the layout policy associated with the given extent's end glyph. | 4991 Return the layout policy associated with the given extent's end glyph. |
4992 Set this using the `set-extent-end-glyph-layout' function. | 4992 Set this using the `set-extent-end-glyph-layout' function. |
4993 */ | 4993 */ |
4994 (extent)) | 4994 (extent)) |
4995 { | 4995 { |
4996 EXTENT e = decode_extent (extent, 0); | 4996 EXTENT e = decode_extent (extent, 0); |
4997 return glyph_layout_to_symbol (extent_end_glyph_layout (e)); | 4997 return glyph_layout_to_symbol ((glyph_layout) extent_end_glyph_layout (e)); |
4998 } | 4998 } |
4999 | 4999 |
5000 DEFUN ("set-extent-priority", Fset_extent_priority, 2, 2, 0, /* | 5000 DEFUN ("set-extent-priority", Fset_extent_priority, 2, 2, 0, /* |
5001 Set the display priority of EXTENT to PRIORITY (an integer). | 5001 Set the display priority of EXTENT to PRIORITY (an integer). |
5002 When the extent attributes are being merged for display, the priority | 5002 When the extent attributes are being merged for display, the priority |
5337 */ | 5337 */ |
5338 (extent)) | 5338 (extent)) |
5339 { | 5339 { |
5340 EXTENT e, anc; | 5340 EXTENT e, anc; |
5341 Lisp_Object result, face, anc_obj; | 5341 Lisp_Object result, face, anc_obj; |
5342 enum glyph_layout layout; | 5342 glyph_layout layout; |
5343 | 5343 |
5344 CHECK_EXTENT (extent); | 5344 CHECK_EXTENT (extent); |
5345 e = XEXTENT (extent); | 5345 e = XEXTENT (extent); |
5346 if (!EXTENT_LIVE_P (e)) | 5346 if (!EXTENT_LIVE_P (e)) |
5347 return cons3 (Qdestroyed, Qt, Qnil); | 5347 return cons3 (Qdestroyed, Qt, Qnil); |
5357 result = cons3 (Qface, face, result); | 5357 result = cons3 (Qface, face, result); |
5358 | 5358 |
5359 if (!NILP (face = Fextent_mouse_face (anc_obj))) | 5359 if (!NILP (face = Fextent_mouse_face (anc_obj))) |
5360 result = cons3 (Qmouse_face, face, result); | 5360 result = cons3 (Qmouse_face, face, result); |
5361 | 5361 |
5362 if ((layout = extent_begin_glyph_layout (anc)) != GL_TEXT) | 5362 if ((layout = (glyph_layout) extent_begin_glyph_layout (anc)) != GL_TEXT) |
5363 { | 5363 { |
5364 Lisp_Object sym = glyph_layout_to_symbol (layout); | 5364 Lisp_Object sym = glyph_layout_to_symbol (layout); |
5365 result = cons3 (Qglyph_layout, sym, result); /* compatibility */ | 5365 result = cons3 (Qglyph_layout, sym, result); /* compatibility */ |
5366 result = cons3 (Qbegin_glyph_layout, sym, result); | 5366 result = cons3 (Qbegin_glyph_layout, sym, result); |
5367 } | 5367 } |
5368 | 5368 |
5369 if ((layout = extent_end_glyph_layout (anc)) != GL_TEXT) | 5369 if ((layout = (glyph_layout) extent_end_glyph_layout (anc)) != GL_TEXT) |
5370 result = cons3 (Qend_glyph_layout, glyph_layout_to_symbol (layout), result); | 5370 result = cons3 (Qend_glyph_layout, glyph_layout_to_symbol (layout), result); |
5371 | 5371 |
5372 if (!NILP (extent_end_glyph (anc))) | 5372 if (!NILP (extent_end_glyph (anc))) |
5373 result = cons3 (Qend_glyph, extent_end_glyph (anc), result); | 5373 result = cons3 (Qend_glyph, extent_end_glyph (anc), result); |
5374 | 5374 |
6273 get_buffer_or_string_range_byte (object, start, end, &s, &e, 0); | 6273 get_buffer_or_string_range_byte (object, start, end, &s, &e, 0); |
6274 put_text_prop (s, e, object, prop, value, 1); | 6274 put_text_prop (s, e, object, prop, value, 1); |
6275 return prop; | 6275 return prop; |
6276 } | 6276 } |
6277 | 6277 |
6278 DEFUN ("put-nonduplicable-text-property", | 6278 DEFUN ("put-nonduplicable-text-property", Fput_nonduplicable_text_property, |
6279 Fput_nonduplicable_text_property, 4, 5, 0, /* | 6279 4, 5, 0, /* |
6280 Adds the given property/value to all characters in the specified region. | 6280 Adds the given property/value to all characters in the specified region. |
6281 The property is conceptually attached to the characters rather than the | 6281 The property is conceptually attached to the characters rather than the |
6282 region, however the properties will not be copied when the characters | 6282 region, however the properties will not be copied when the characters |
6283 are copied. | 6283 are copied. |
6284 Fifth argument OBJECT is the buffer or string containing the text, and | 6284 Fifth argument OBJECT is the buffer or string containing the text, and |
6319 } | 6319 } |
6320 return changed ? Qt : Qnil; | 6320 return changed ? Qt : Qnil; |
6321 } | 6321 } |
6322 | 6322 |
6323 | 6323 |
6324 DEFUN ("add-nonduplicable-text-properties", | 6324 DEFUN ("add-nonduplicable-text-properties", Fadd_nonduplicable_text_properties, |
6325 Fadd_nonduplicable_text_properties, 3, 4, 0, /* | 6325 3, 4, 0, /* |
6326 Add nonduplicable properties to the characters from START to END. | 6326 Add nonduplicable properties to the characters from START to END. |
6327 \(The properties will not be copied when the characters are copied.) | 6327 \(The properties will not be copied when the characters are copied.) |
6328 The third argument PROPS is a property list specifying the property values | 6328 The third argument PROPS is a property list specifying the property values |
6329 to add. The optional fourth argument, OBJECT, is the buffer or string | 6329 to add. The optional fourth argument, OBJECT, is the buffer or string |
6330 containing the text and defaults to the current buffer. Returns t if | 6330 containing the text and defaults to the current buffer. Returns t if |
6382 | 6382 |
6383 The lisp implementation of this was probably fast enough, but since I moved | 6383 The lisp implementation of this was probably fast enough, but since I moved |
6384 the rest of the put-text-prop code here, I moved this as well for | 6384 the rest of the put-text-prop code here, I moved this as well for |
6385 completeness. | 6385 completeness. |
6386 */ | 6386 */ |
6387 DEFUN ("text-prop-extent-paste-function", | 6387 DEFUN ("text-prop-extent-paste-function", Ftext_prop_extent_paste_function, |
6388 Ftext_prop_extent_paste_function, 3, 3, 0, /* | 6388 3, 3, 0, /* |
6389 Used as the `paste-function' property of `text-prop' extents. | 6389 Used as the `paste-function' property of `text-prop' extents. |
6390 */ | 6390 */ |
6391 (extent, from, to)) | 6391 (extent, from, to)) |
6392 { | 6392 { |
6393 /* This function can GC */ | 6393 /* This function can GC */ |
6412 | 6412 |
6413 /* This function could easily be written in Lisp but the C code wants | 6413 /* This function could easily be written in Lisp but the C code wants |
6414 to use it in connection with invisible extents (at least currently). | 6414 to use it in connection with invisible extents (at least currently). |
6415 If this changes, consider moving this back into Lisp. */ | 6415 If this changes, consider moving this back into Lisp. */ |
6416 | 6416 |
6417 DEFUN ("next-single-property-change", Fnext_single_property_change, 2, 4, 0, /* | 6417 DEFUN ("next-single-property-change", Fnext_single_property_change, |
6418 2, 4, 0, /* | |
6418 Return the position of next property change for a specific property. | 6419 Return the position of next property change for a specific property. |
6419 Scans characters forward from POS till it finds a change in the PROP | 6420 Scans characters forward from POS till it finds a change in the PROP |
6420 property, then returns the position of the change. The optional third | 6421 property, then returns the position of the change. The optional third |
6421 argument OBJECT is the buffer or string to scan (defaults to the current | 6422 argument OBJECT is the buffer or string to scan (defaults to the current |
6422 buffer). | 6423 buffer). |
6478 return make_int (blim); | 6479 return make_int (blim); |
6479 } | 6480 } |
6480 | 6481 |
6481 /* See comment on previous function about why this is written in C. */ | 6482 /* See comment on previous function about why this is written in C. */ |
6482 | 6483 |
6483 DEFUN ("previous-single-property-change", | 6484 DEFUN ("previous-single-property-change", Fprevious_single_property_change, |
6484 Fprevious_single_property_change, 2, 4, 0, /* | 6485 2, 4, 0, /* |
6485 Return the position of next property change for a specific property. | 6486 Return the position of next property change for a specific property. |
6486 Scans characters backward from POS till it finds a change in the PROP | 6487 Scans characters backward from POS till it finds a change in the PROP |
6487 property, then returns the position of the change. The optional third | 6488 property, then returns the position of the change. The optional third |
6488 argument OBJECT is the buffer or string to scan (defaults to the current | 6489 argument OBJECT is the buffer or string to scan (defaults to the current |
6489 buffer). | 6490 buffer). |