help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Abbrev-mode question


From: Stefan Monnier
Subject: Re: Abbrev-mode question
Date: Wed, 12 Sep 2007 02:13:32 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

> As core functions `expand-abbrev' are written
> in C in both Emacsen, that's probably not so easy to
> change.

Actually, AFAIK the only entry point called from C is expand-abbrev and that
is called via the `expand-abbrev' symbol rather than calling the
Fexpand_abbrev C function (a change I installed for Emacs-21.1 IIRC), so you
can redefine all the abbrev functions in elisp and have them work just as
well as before.

> An extended abbrev-mode in Emacs-Lisp checking phrases
> all the time may end up slow.  Wouldn't undertake that,
> rather ask in emacs-devel for an implementation in C.

An abbrev-mode in ELisp with the same behavior as the current one is about
as fast as it is in C.  Extending it to multi-word abbrevs might slow it
down significantly, but that's also true in C.  The main issue is rather how
to avoid the slowdown, which depends on further info:
- how many multi-word abbrevs are we talking about?
- how can we determine the start (so as not to mistake "afool bo" for a case
  where the "ol bo" abbrev should be expanded)?  Should it also necessarily
  start with a word boundary?
- can be put a reasonable upper limit on the number of words in a multi-word
  abbrev (2 or 3, maybe)?


        Stefan "whose abbrev-mode is all written in ELisp"


reply via email to

[Prev in Thread] Current Thread [Next in Thread]