
console_input.pl -- Support entering toplevel queriesThis module implements prolog:complete_input/4, which is used notably by the command line editor library(edit) to perform context aware TAB completion. It is a seperate library such that other input scenarios can reuse this code.
prolog:complete_input(+BeforeCursor:string, +AfterCursor:string, -Delete:atom, -Completions:list) is semidet[multifile]'<prefix> (single quotes) is completed as a
file. If there is a single matching file a terminating `'` is
added.[<prefix> and text can be
a non-quoted atom, look for Prolog files with this name.
Directories can be inserted as / (unquoted), as long as
each segment is a valid atom. If a single .pl file
is found it is closed with ], without the extension.library(<prefix> is completed as a
library file using the same rules as [<prefix>, but
looking in all library directories instead of the current
directory.<prefix> is used to complete atoms that can be written
without quotes (excluding symbol atoms such as -->) and
are permanent, i.e., have references from clauses records,
flags, foreign code, etc.<Prefix> is completed as an atom if it is a valid variable
name. It is completed with other atoms from the query being
edited using the same search as Emacs dabbrev (Dynamic
Abbreviation). $<Prefix> expands to saved toplevel
variables.