/[emacs]/emacs/src/textprop.c
ViewVC logotype

Diff of /emacs/src/textprop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.118 by pj, Fri Nov 2 20:34:03 2001 UTC revision 1.119 by rms, Sun Nov 11 20:03:24 2001 UTC
# Line 1290  set_text_properties (start, end, propert Line 1290  set_text_properties (start, end, propert
1290          return Qnil;          return Qnil;
1291      }      }
1292    
   s = XINT (start);  
   len = XINT (end) - s;  
   
1293    if (BUFFERP (object))    if (BUFFERP (object))
1294      modify_region (XBUFFER (object), XINT (start), XINT (end));      modify_region (XBUFFER (object), XINT (start), XINT (end));
1295    
1296      set_text_properties_1 (start, end, properties, object, i);
1297    
1298      if (BUFFERP (object) && !NILP (signal_after_change_p))
1299        signal_after_change (XINT (start), XINT (end) - XINT (start),
1300                             XINT (end) - XINT (start));
1301      return Qt;
1302    }
1303    
1304    /* Replace properties of text from START to END with new list of
1305       properties PROPERTIES.  BUFFER is the buffer containing
1306       the text.  This does not obey any hooks.
1307       You can provide the interval that START is located in as I,
1308       or pass NULL for I and this function will find it.  */
1309    
1310    void
1311    set_text_properties_1 (start, end, properties, buffer, i)
1312         Lisp_Object start, end, properties, buffer;
1313         INTERVAL i;
1314    {
1315      register INTERVAL prev_changed = NULL_INTERVAL;
1316      register int s, len;
1317      INTERVAL unchanged;
1318    
1319      s = XINT (start);
1320      len = XINT (end) - s;
1321      if (i == 0)
1322        i = find_interval (BUF_INTERVALS (XBUFFER (buffer)), s);
1323    
1324    if (i->position != s)    if (i->position != s)
1325      {      {
1326        unchanged = i;        unchanged = i;
# Line 1305  set_text_properties (start, end, propert Line 1330  set_text_properties (start, end, propert
1330          {          {
1331            copy_properties (unchanged, i);            copy_properties (unchanged, i);
1332            i = split_interval_left (i, len);            i = split_interval_left (i, len);
1333            set_properties (properties, i, object);            set_properties (properties, i, buffer);
1334            if (BUFFERP (object) && !NILP (signal_after_change_p))            return;
             signal_after_change (XINT (start), XINT (end) - XINT (start),  
                                  XINT (end) - XINT (start));  
   
           return Qt;  
1335          }          }
1336    
1337        set_properties (properties, i, object);        set_properties (properties, i, buffer);
1338    
1339        if (LENGTH (i) == len)        if (LENGTH (i) == len)
1340          {          return;
           if (BUFFERP (object) && !NILP (signal_after_change_p))  
             signal_after_change (XINT (start), XINT (end) - XINT (start),  
                                  XINT (end) - XINT (start));  
   
           return Qt;  
         }  
1341    
1342        prev_changed = i;        prev_changed = i;
1343        len -= LENGTH (i);        len -= LENGTH (i);
# Line 1343  set_text_properties (start, end, propert Line 1358  set_text_properties (start, end, propert
1358            /* We have to call set_properties even if we are going to            /* We have to call set_properties even if we are going to
1359               merge the intervals, so as to make the undo records               merge the intervals, so as to make the undo records
1360               and cause redisplay to happen.  */               and cause redisplay to happen.  */
1361            set_properties (properties, i, object);            set_properties (properties, i, buffer);
1362            if (!NULL_INTERVAL_P (prev_changed))            if (!NULL_INTERVAL_P (prev_changed))
1363              merge_interval_left (i);              merge_interval_left (i);
1364            if (BUFFERP (object) && !NILP (signal_after_change_p))            return;
             signal_after_change (XINT (start), XINT (end) - XINT (start),  
                                  XINT (end) - XINT (start));  
           return Qt;  
1365          }          }
1366    
1367        len -= LENGTH (i);        len -= LENGTH (i);
# Line 1357  set_text_properties (start, end, propert Line 1369  set_text_properties (start, end, propert
1369        /* We have to call set_properties even if we are going to        /* We have to call set_properties even if we are going to
1370           merge the intervals, so as to make the undo records           merge the intervals, so as to make the undo records
1371           and cause redisplay to happen.  */           and cause redisplay to happen.  */
1372        set_properties (properties, i, object);        set_properties (properties, i, buffer);
1373        if (NULL_INTERVAL_P (prev_changed))        if (NULL_INTERVAL_P (prev_changed))
1374          prev_changed = i;          prev_changed = i;
1375        else        else
# Line 1365  set_text_properties (start, end, propert Line 1377  set_text_properties (start, end, propert
1377    
1378        i = next_interval (i);        i = next_interval (i);
1379      }      }
   
   if (BUFFERP (object) && !NILP (signal_after_change_p))  
     signal_after_change (XINT (start), XINT (end) - XINT (start),  
                          XINT (end) - XINT (start));  
   return Qt;  
1380  }  }
1381    
1382  DEFUN ("remove-text-properties", Fremove_text_properties,  DEFUN ("remove-text-properties", Fremove_text_properties,

Legend:
Removed from v.1.118  
changed lines
  Added in v.1.119

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26