ThibautVerron / magma-mode

An emacs major-mode for editing magma files
5 stars 1 forks source link

Completion in comint buffers, and in the editting window #1

Open ThibautVerron opened 10 years ago

ThibautVerron commented 10 years ago

With comint, since the line is sent as a whole, it seems difficult to trigger magma's completion engine from emacs. On the other hand, with a list of magma keywords, it should be possible to implement completion from within emacs (see for example what happens if you press <tab> in ielm).

That list of keywords could be initialized from the magma documentation index, and then completed with user keywords using filters and sentinels in the comint buffer.

Another option would be to parse the input and source using etags.

ThibautVerron commented 10 years ago

Work in progress in the completion branch.

Working:

Todo:

ThibautVerron commented 10 years ago

Replaced the extraction of definitions using imenu with some in-house function magma-scan, which is also aware of changes in the working directory and loaded files.

It passes basic testing, but requires some more test to ensure that it isn't too slow in everyday use. No attempt has been made at caching any result.

This function is called:

ThibautVerron commented 10 years ago

Reimplemented it with caching of the scan results.

It can probably still be improved: