all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Extending the abbrev facility in elisp
@ 2003-05-22 14:14 Stefan Monnier
  2003-05-23 22:49 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2003-05-22 14:14 UTC (permalink / raw)


It seems that there is no easy way to extend the abbrev facility in elisp
because all the processing is done in C.  Any objection to the patch below
which makes it possible to redefine, advise, debug-on-entry, ...
`expand-abbrev' ?
Or should we introduce an `expand-abbrev-functions' hook instead ?


	Stefan


Index: cmds.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/cmds.c,v
retrieving revision 1.88
diff -u -r1.88 cmds.c
--- cmds.c	9 Nov 2002 12:46:25 -0000	1.88
+++ cmds.c	22 May 2003 14:07:47 -0000
@@ -368,12 +368,13 @@
    return 0.  A value of 1 indicates this *might* not have been simple.
    A value of 2 means this did things that call for an undo boundary.  */
 
+static Lisp_Object Qexpand_abbrev;
+
 int
 internal_self_insert (c, noautofill)
      int c;
      int noautofill;
 {
-  extern Lisp_Object Fexpand_abbrev ();
   int hairy = 0;
   Lisp_Object tem;
   register enum syntaxcode synt;
@@ -477,7 +478,7 @@
       int modiff = MODIFF;
       Lisp_Object sym;
 
-      sym = Fexpand_abbrev ();
+      sym = call0 (Qexpand_abbrev);
 
       /* If we expanded an abbrev which has a hook,
 	 and the hook has a non-nil `no-self-insert' property,
@@ -564,6 +565,9 @@
 
   Qoverwrite_mode_binary = intern ("overwrite-mode-binary");
   staticpro (&Qoverwrite_mode_binary);
+
+  Qexpand_abbrev = intern ("expand-abbrev");
+  staticpro (&Qexpand_abbrev);
 
   DEFVAR_LISP ("self-insert-face", &Vself_insert_face,
 	       doc: /* If non-nil, set the face of the next self-inserting character to this.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Extending the abbrev facility in elisp
  2003-05-22 14:14 Extending the abbrev facility in elisp Stefan Monnier
@ 2003-05-23 22:49 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2003-05-23 22:49 UTC (permalink / raw)
  Cc: emacs-devel

    It seems that there is no easy way to extend the abbrev facility in elisp
    because all the processing is done in C.  Any objection to the patch below
    which makes it possible to redefine, advise, debug-on-entry, ...
    `expand-abbrev' ?

I have no real objection, but I wish people would implement some
of the important projects in etc/TODO rather than making extensions
like these.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-23 22:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-22 14:14 Extending the abbrev facility in elisp Stefan Monnier
2003-05-23 22:49 ` Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.