emacs-devel
[Top][All Lists]
Advanced

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

Re: Abbrev should preserve case


From: Andreas Röhler
Subject: Re: Abbrev should preserve case
Date: Thu, 21 Jun 2007 11:00:23 +0200
User-agent: KMail/1.8.2

Am Donnerstag, 21. Juni 2007 10:01 schrieb Stefan Monnier:
> > Might it not be the best solution to drop the down-case
> > commands in abbrev.c?
>
> The case-insensitivity (and magical treatment of case in general) is
> a feature, as evidenced by the amount of extra code in abbrev.c to
> implement it.  So we do not want to just throw it all out.

Hmm. To preserve the status quo quite often is a wise
decision. Will see...


> > Imaging the use of machine written abbrevs for NLP, context analyses
> > etc., speed will matter. Therefore I suggest to do the work in C as far
> > as possible, avoid re-implementations. (I intend to take part here as far
> > as it's welcome and I'm able to.)
>
> The expand-abbrev code has no loop.  So there is no issue
> w.r.t performance (at least as long as we stick to the current constraint
> that abbreviations can only contain chars of word-syntax"): the code of
> expand-abbrev basically extracts the word before point, looks it up in
> a hash-table (actually, an obarray) and then uses the result to do the
> expansion (if any).  The only part that will get slower with larger
> abbrev-tables is the hash-lookup which is coded in C anyway.
>
> > Please consider if a derived mode must copy all the
> > abbrevs. I'd say a derived mode should rather note the
> > differences, but read the major-mode first. Then the
> > abbrev-file, which already counts 500K here, would
> > shrink a lot.
>
> This may be solved by the use of inheritance. 

I'm looking forward for that. 

> Although given the rather 
> limited amount of derived major modes in use, I'm not sure your 500KB would
> really shrink that much.
>

You mentioned abbreviations depending on the
context. That could explode the size with the current
copying.





reply via email to

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