unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Subject: Extending the abbrev facility in elisp
Date: Thu, 22 May 2003 10:14:32 -0400	[thread overview]
Message-ID: <200305221414.h4MEEWIB004312@rum.cs.yale.edu> (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.

             reply	other threads:[~2003-05-22 14:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-22 14:14 Stefan Monnier [this message]
2003-05-23 22:49 ` Extending the abbrev facility in elisp Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200305221414.h4MEEWIB004312@rum.cs.yale.edu \
    --to=monnier+gnu/emacs@rum.cs.yale.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).