emacs-devel
[Top][All Lists]
Advanced

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

Re: Abbrev suggestions - feedback appreciated


From: Mathias Dahl
Subject: Re: Abbrev suggestions - feedback appreciated
Date: Sun, 17 Sep 2017 15:22:32 +0200

Hi Stefan, thanks for your comments.

I like the feature.  Here are some comments:

- The expansion is not necessarily a "word".

True. I thought about that and concluded that it would be a lot harder
to look for more than one words, matching a certain expansion. It will
be especially tricky, I think, if the words the user types and which
match an extension, spans more than one line. Of course not impossible but
I thought I would start with the easy and probably quite common use
case.

- The `expansions` list is built only to then pass it to `assoc`.
  You could avoid constructing the list by passing `word` to
  absug-get-active-abbrev-expansions and have it check equality as it goes.

That's a good optimization, thanks! At least as long as I am not trying
to tackle multi-word expansions. In that case, I don't know on
beforehand how many words to match. Again, surely possible to
solve... One way might be to save not one but, say, ten previous words,
and send that in to the function that will look for expansions matching
that. It would of course break on eleven words and above...

Any clever ideas? :) I might surely be able to do this, but I am also concerned
about performance here.


reply via email to

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