Mercurial > emacs
comparison src/textprop.c @ 8907:f7de8b4cb1b8
(validate_interval_range, property_value, Fget_char_property,
Fnext_property_change, Fnext_single_property_change,
Fprevious_property_change, Fprevious_single_property_change): Fix Lisp_Object
vs. int problems.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Mon, 19 Sep 1994 00:18:27 +0000 |
parents | 7e9547af43e8 |
children | 722763fed8ce |
comparison
equal
deleted
inserted
replaced
8906:93f3d6f5753c | 8907:f7de8b4cb1b8 |
---|---|
100 CHECK_NUMBER_COERCE_MARKER (*begin, 0); | 100 CHECK_NUMBER_COERCE_MARKER (*begin, 0); |
101 CHECK_NUMBER_COERCE_MARKER (*end, 0); | 101 CHECK_NUMBER_COERCE_MARKER (*end, 0); |
102 | 102 |
103 /* If we are asked for a point, but from a subr which operates | 103 /* If we are asked for a point, but from a subr which operates |
104 on a range, then return nothing. */ | 104 on a range, then return nothing. */ |
105 if (*begin == *end && begin != end) | 105 if (EQ (*begin, *end) && begin != end) |
106 return NULL_INTERVAL; | 106 return NULL_INTERVAL; |
107 | 107 |
108 if (XINT (*begin) > XINT (*end)) | 108 if (XINT (*begin) > XINT (*end)) |
109 { | 109 { |
110 Lisp_Object n; | 110 Lisp_Object n; |
246 | 246 |
247 /* Changing the plists of individual intervals. */ | 247 /* Changing the plists of individual intervals. */ |
248 | 248 |
249 /* Return the value of PROP in property-list PLIST, or Qunbound if it | 249 /* Return the value of PROP in property-list PLIST, or Qunbound if it |
250 has none. */ | 250 has none. */ |
251 static int | 251 static Lisp_Object |
252 property_value (plist, prop) | 252 property_value (plist, prop) |
253 Lisp_Object plist, prop; | 253 Lisp_Object plist, prop; |
254 { | 254 { |
255 Lisp_Object value; | 255 Lisp_Object value; |
256 | 256 |
527 XSET (object, Lisp_Buffer, current_buffer); | 527 XSET (object, Lisp_Buffer, current_buffer); |
528 | 528 |
529 if (WINDOWP (object)) | 529 if (WINDOWP (object)) |
530 { | 530 { |
531 w = XWINDOW (object); | 531 w = XWINDOW (object); |
532 XSET (object, Lisp_Buffer, w->buffer); | 532 object = w->buffer; |
533 } | 533 } |
534 if (BUFFERP (object)) | 534 if (BUFFERP (object)) |
535 { | 535 { |
536 int posn = XINT (pos); | 536 int posn = XINT (pos); |
537 int noverlays; | 537 int noverlays; |
601 if (NULL_INTERVAL_P (next)) | 601 if (NULL_INTERVAL_P (next)) |
602 return limit; | 602 return limit; |
603 if (! NILP (limit) && !(next->position < XFASTINT (limit))) | 603 if (! NILP (limit) && !(next->position < XFASTINT (limit))) |
604 return limit; | 604 return limit; |
605 | 605 |
606 return next->position - (XTYPE (object) == Lisp_String); | 606 XFASTINT (pos) = next->position - (XTYPE (object) == Lisp_String); |
607 return pos; | |
607 } | 608 } |
608 | 609 |
609 /* Return 1 if there's a change in some property between BEG and END. */ | 610 /* Return 1 if there's a change in some property between BEG and END. */ |
610 | 611 |
611 int | 612 int |
675 if (NULL_INTERVAL_P (next)) | 676 if (NULL_INTERVAL_P (next)) |
676 return limit; | 677 return limit; |
677 if (! NILP (limit) && !(next->position < XFASTINT (limit))) | 678 if (! NILP (limit) && !(next->position < XFASTINT (limit))) |
678 return limit; | 679 return limit; |
679 | 680 |
680 return next->position - (XTYPE (object) == Lisp_String); | 681 XFASTINT (pos) = next->position - (XTYPE (object) == Lisp_String); |
682 return pos; | |
681 } | 683 } |
682 | 684 |
683 DEFUN ("previous-property-change", Fprevious_property_change, | 685 DEFUN ("previous-property-change", Fprevious_property_change, |
684 Sprevious_property_change, 1, 3, 0, | 686 Sprevious_property_change, 1, 3, 0, |
685 "Return the position of previous property change.\n\ | 687 "Return the position of previous property change.\n\ |
718 return limit; | 720 return limit; |
719 if (!NILP (limit) | 721 if (!NILP (limit) |
720 && !(previous->position + LENGTH (previous) > XFASTINT (limit))) | 722 && !(previous->position + LENGTH (previous) > XFASTINT (limit))) |
721 return limit; | 723 return limit; |
722 | 724 |
723 return (previous->position + LENGTH (previous) | 725 XFASTINT (pos) = (previous->position + LENGTH (previous) |
724 - (XTYPE (object) == Lisp_String)); | 726 - (XTYPE (object) == Lisp_String)); |
727 return pos; | |
725 } | 728 } |
726 | 729 |
727 DEFUN ("previous-single-property-change", Fprevious_single_property_change, | 730 DEFUN ("previous-single-property-change", Fprevious_single_property_change, |
728 Sprevious_single_property_change, 2, 4, 0, | 731 Sprevious_single_property_change, 2, 4, 0, |
729 "Return the position of previous property change for a specific property.\n\ | 732 "Return the position of previous property change for a specific property.\n\ |
767 return limit; | 770 return limit; |
768 if (!NILP (limit) | 771 if (!NILP (limit) |
769 && !(previous->position + LENGTH (previous) > XFASTINT (limit))) | 772 && !(previous->position + LENGTH (previous) > XFASTINT (limit))) |
770 return limit; | 773 return limit; |
771 | 774 |
772 return (previous->position + LENGTH (previous) | 775 XFASTINT (pos) = (previous->position + LENGTH (previous) |
773 - (XTYPE (object) == Lisp_String)); | 776 - (XTYPE (object) == Lisp_String)); |
777 return pos; | |
774 } | 778 } |
775 | 779 |
776 DEFUN ("add-text-properties", Fadd_text_properties, | 780 DEFUN ("add-text-properties", Fadd_text_properties, |
777 Sadd_text_properties, 3, 4, 0, | 781 Sadd_text_properties, 3, 4, 0, |
778 "Add properties to the text from START to END.\n\ | 782 "Add properties to the text from START to END.\n\ |