comparison src/cmds.c @ 8088:a831980bb12e

(internal_self_insert): Now can return 2.
author Richard M. Stallman <rms@gnu.org>
date Wed, 29 Jun 1994 19:51:33 +0000
parents cd81dba38a49
children e64cf8a4bf28
comparison
equal deleted inserted replaced
8087:c22d7c5168f5 8088:a831980bb12e
282 282
283 /* Insert character C1. If NOAUTOFILL is nonzero, don't do autofill 283 /* Insert character C1. If NOAUTOFILL is nonzero, don't do autofill
284 even if it is enabled. 284 even if it is enabled.
285 285
286 If this insertion is suitable for direct output (completely simple), 286 If this insertion is suitable for direct output (completely simple),
287 return 0. A value of 1 indicates this *might* not have been simple. */ 287 return 0. A value of 1 indicates this *might* not have been simple.
288 A value of 2 means this did things that call for an undo boundary. */
288 289
289 internal_self_insert (c1, noautofill) 290 internal_self_insert (c1, noautofill)
290 char c1; 291 char c1;
291 int noautofill; 292 int noautofill;
292 { 293 {
311 || XINT (current_buffer->tab_width) <= 0 312 || XINT (current_buffer->tab_width) <= 0
312 || XFASTINT (current_buffer->tab_width) > 20 313 || XFASTINT (current_buffer->tab_width) > 20
313 || !((current_column () + 1) % XFASTINT (current_buffer->tab_width)))) 314 || !((current_column () + 1) % XFASTINT (current_buffer->tab_width))))
314 { 315 {
315 del_range (point, point + 1); 316 del_range (point, point + 1);
316 hairy = 1; 317 hairy = 2;
317 } 318 }
318 if (!NILP (current_buffer->abbrev_mode) 319 if (!NILP (current_buffer->abbrev_mode)
319 && SYNTAX (c) != Sword 320 && SYNTAX (c) != Sword
320 && NILP (current_buffer->read_only) 321 && NILP (current_buffer->read_only)
321 && point > BEGV && SYNTAX (FETCH_CHAR (point - 1)) == Sword) 322 && point > BEGV && SYNTAX (FETCH_CHAR (point - 1)) == Sword)
324 Fexpand_abbrev (); 325 Fexpand_abbrev ();
325 /* We can't trust the value of Fexpand_abbrev, 326 /* We can't trust the value of Fexpand_abbrev,
326 but if Fexpand_abbrev changed the buffer, 327 but if Fexpand_abbrev changed the buffer,
327 assume it expanded something. */ 328 assume it expanded something. */
328 if (MODIFF != modiff) 329 if (MODIFF != modiff)
329 hairy = 1; 330 hairy = 2;
330 } 331 }
331 if ((c == ' ' || c == '\n') 332 if ((c == ' ' || c == '\n')
332 && !noautofill 333 && !noautofill
333 && !NILP (current_buffer->auto_fill_function) 334 && !NILP (current_buffer->auto_fill_function)
334 && current_column () > XFASTINT (current_buffer->fill_column)) 335 && current_column () > XFASTINT (current_buffer->fill_column))
336 if (c1 != '\n') 337 if (c1 != '\n')
337 insert (&c1, 1); 338 insert (&c1, 1);
338 call0 (current_buffer->auto_fill_function); 339 call0 (current_buffer->auto_fill_function);
339 if (c1 == '\n') 340 if (c1 == '\n')
340 insert (&c1, 1); 341 insert (&c1, 1);
341 hairy = 1; 342 hairy = 2;
342 } 343 }
343 else 344 else
344 insert (&c1, 1); 345 insert (&c1, 1);
345 synt = SYNTAX (c); 346 synt = SYNTAX (c);
346 if ((synt == Sclose || synt == Smath) 347 if ((synt == Sclose || synt == Smath)
347 && !NILP (Vblink_paren_function) && INTERACTIVE) 348 && !NILP (Vblink_paren_function) && INTERACTIVE)
348 { 349 {
349 call0 (Vblink_paren_function); 350 call0 (Vblink_paren_function);
350 hairy = 1; 351 hairy = 2;
351 } 352 }
352 return hairy; 353 return hairy;
353 } 354 }
354 355
355 /* module initialization */ 356 /* module initialization */