Closed lokedhs closed 8 years ago
Elisp ref: https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion-in-Buffers.html
completion-at-point-functions
docstring:
https://docstrings.github.io/sym/completion-at-point-functions.html
Just jotting down some notes.
In general, there are two ways to figure out information about Forth programs:
In this case, the imenu
thingy already has a good idea about all definitions in a buffer, so maybe use that?
I already have a function forth-words
which returns a list of strings: all known definitions in an interactive Forth session. Of course, Forth can't know about symbols unless the file has been loaded.
The imenu parser will only parse files which are actively being processed (for example, as the result of the file being opened in a buffer, or when navigating to it using speedbar). It can't really be used to enumerate all files in a project.
Sure, I had no expectations it would search other files.
Added symbol comletion in cc267b4.
To implement symbol completion, set the variable
completion-at-point-functions
to a list of completion functions (usually only one):The behaviour of the symbol expansion function is described in the documentation for the variable
completion-at-point-functions
.