comparison src/cmds.c @ 51819:ff438bca7989

(Qexpand_abbrev): New sym. (syms_of_cmds): Initialize it. (internal_self_insert): Use it to call expand-abbrev.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 08 Jul 2003 21:25:35 +0000
parents 461d780ae946
children 695cf19ef79e
comparison
equal deleted inserted replaced
51818:c23aefddb54a 51819:ff438bca7989
1 /* Simple built-in editing commands. 1 /* Simple built-in editing commands.
2 Copyright (C) 1985, 93, 94, 95, 96, 97, 1998, 2001, 02 Free Software Foundation, Inc. 2 Copyright (C) 1985, 93, 94, 95, 96, 97, 1998, 2001, 02, 03
3 Free Software Foundation, Inc.
3 4
4 This file is part of GNU Emacs. 5 This file is part of GNU Emacs.
5 6
6 GNU Emacs is free software; you can redistribute it and/or modify 7 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
366 367
367 If this insertion is suitable for direct output (completely simple), 368 If this insertion is suitable for direct output (completely simple),
368 return 0. A value of 1 indicates this *might* not have been simple. 369 return 0. A value of 1 indicates this *might* not have been simple.
369 A value of 2 means this did things that call for an undo boundary. */ 370 A value of 2 means this did things that call for an undo boundary. */
370 371
372 static Lisp_Object Qexpand_abbrev;
373
371 int 374 int
372 internal_self_insert (c, noautofill) 375 internal_self_insert (c, noautofill)
373 int c; 376 int c;
374 int noautofill; 377 int noautofill;
375 { 378 {
376 extern Lisp_Object Fexpand_abbrev ();
377 int hairy = 0; 379 int hairy = 0;
378 Lisp_Object tem; 380 Lisp_Object tem;
379 register enum syntaxcode synt; 381 register enum syntaxcode synt;
380 Lisp_Object overwrite, string; 382 Lisp_Object overwrite, string;
381 /* Length of multi-byte form of C. */ 383 /* Length of multi-byte form of C. */
475 && PT > BEGV && SYNTAX (XFASTINT (Fprevious_char ())) == Sword) 477 && PT > BEGV && SYNTAX (XFASTINT (Fprevious_char ())) == Sword)
476 { 478 {
477 int modiff = MODIFF; 479 int modiff = MODIFF;
478 Lisp_Object sym; 480 Lisp_Object sym;
479 481
480 sym = Fexpand_abbrev (); 482 sym = call0 (Qexpand_abbrev);
481 483
482 /* If we expanded an abbrev which has a hook, 484 /* If we expanded an abbrev which has a hook,
483 and the hook has a non-nil `no-self-insert' property, 485 and the hook has a non-nil `no-self-insert' property,
484 return right away--don't really self-insert. */ 486 return right away--don't really self-insert. */
485 if (! NILP (sym) && ! NILP (XSYMBOL (sym)->function) 487 if (! NILP (sym) && ! NILP (XSYMBOL (sym)->function)
563 staticpro (&Qkill_forward_chars); 565 staticpro (&Qkill_forward_chars);
564 566
565 Qoverwrite_mode_binary = intern ("overwrite-mode-binary"); 567 Qoverwrite_mode_binary = intern ("overwrite-mode-binary");
566 staticpro (&Qoverwrite_mode_binary); 568 staticpro (&Qoverwrite_mode_binary);
567 569
570 Qexpand_abbrev = intern ("expand-abbrev");
571 staticpro (&Qexpand_abbrev);
572
568 DEFVAR_LISP ("self-insert-face", &Vself_insert_face, 573 DEFVAR_LISP ("self-insert-face", &Vself_insert_face,
569 doc: /* If non-nil, set the face of the next self-inserting character to this. 574 doc: /* If non-nil, set the face of the next self-inserting character to this.
570 See also `self-insert-face-command'. */); 575 See also `self-insert-face-command'. */);
571 Vself_insert_face = Qnil; 576 Vself_insert_face = Qnil;
572 577