comparison src/cmds.c @ 227:0e522484dd2a r20-5b12

Import from CVS: tag r20-5b12
author cvs
date Mon, 13 Aug 2007 10:12:37 +0200
parents 850242ba4a81
children 8efd647ea9ca
comparison
equal deleted inserted replaced
226:eea38c7ad7b4 227:0e522484dd2a
27 #include "syntax.h" 27 #include "syntax.h"
28 #include "insdel.h" 28 #include "insdel.h"
29 29
30 Lisp_Object Qkill_forward_chars; 30 Lisp_Object Qkill_forward_chars;
31 Lisp_Object Qself_insert_command; 31 Lisp_Object Qself_insert_command;
32 Lisp_Object Qno_self_insert;
32 33
33 Lisp_Object Vblink_paren_function; 34 Lisp_Object Vblink_paren_function;
34 35
35 /* A possible value for a buffer's overwrite-mode variable. */ 36 /* A possible value for a buffer's overwrite-mode variable. */
36 Lisp_Object Qoverwrite_mode_binary; 37 Lisp_Object Qoverwrite_mode_binary;
377 { 378 {
378 c2 = BUF_FETCH_CHAR (buf, BUF_PT (buf) - 1); 379 c2 = BUF_FETCH_CHAR (buf, BUF_PT (buf) - 1);
379 380
380 if (WORD_SYNTAX_P (syntax_table, c2)) 381 if (WORD_SYNTAX_P (syntax_table, c2))
381 { 382 {
382 /* int modiff = BUF_MODIFF (current_buffer); */ 383 Lisp_Object sym = Fexpand_abbrev ();
383 Fexpand_abbrev (); 384
384 /* We can't trust the value of Fexpand_abbrev, 385 /* Here FSFmacs remembers MODIFF, compares it after
385 but if Fexpand_abbrev changed the buffer, 386 Fexpand_abbrev() finishes, and updates HAIRY.
386 assume it expanded something. */ 387
387 /* if (BUF_MODIFF (buf) != modiff) 388 A synch with Emacs 20.2. I'm not sure if it's too bogus
388 hairy = 2; */ 389 to copy, but I guess it can be useful. If we expanded an
390 abbrev which has a hook, and the hook has a non-nil
391 `no-self-insert' property, return right away -- don't
392 really self-insert.
393
394 NOTE: we cannot simply check for Vlast_abbrev, because
395 Fexpand_abbrev() can bail out before setting it to
396 anything meaningful, leaving us stuck with an old value.
397 Thus Fexpand_abbrev() was extended to return the actual
398 abbrev symbol. */
399 if (!NILP (sym)
400 && !NILP (symbol_function (XSYMBOL (sym)))
401 && SYMBOLP (symbol_function (XSYMBOL (sym))))
402 {
403 Lisp_Object prop = Fget (symbol_function (XSYMBOL (sym)),
404 Qno_self_insert, Qnil);
405 if (!NILP (prop))
406 return;
407 }
389 } 408 }
390 } 409 }
391 if ((c1 == ' ' || c1 == '\n') 410 if ((c1 == ' ' || c1 == '\n')
392 && !noautofill 411 && !noautofill
393 && !NILP (buf->auto_fill_function)) 412 && !NILP (buf->auto_fill_function))
451 syms_of_cmds (void) 470 syms_of_cmds (void)
452 { 471 {
453 defsymbol (&Qkill_forward_chars, "kill-forward-chars"); 472 defsymbol (&Qkill_forward_chars, "kill-forward-chars");
454 defsymbol (&Qself_insert_command, "self-insert-command"); 473 defsymbol (&Qself_insert_command, "self-insert-command");
455 defsymbol (&Qoverwrite_mode_binary, "overwrite-mode-binary"); 474 defsymbol (&Qoverwrite_mode_binary, "overwrite-mode-binary");
475 defsymbol (&Qno_self_insert, "no-self-insert");
456 476
457 DEFSUBR (Fforward_char); 477 DEFSUBR (Fforward_char);
458 DEFSUBR (Fbackward_char); 478 DEFSUBR (Fbackward_char);
459 DEFSUBR (Fforward_line); 479 DEFSUBR (Fforward_line);
460 DEFSUBR (Fbeginning_of_line); 480 DEFSUBR (Fbeginning_of_line);