From: Eshel Yaron Date: Tue, 25 Oct 2022 10:52:17 +0000 (+0300) Subject: DOC: added section "Code Completion" to the manual X-Git-Tag: V8.5.20-sweep-0.8.1~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b0834d04f6eeb01b2b61978a72b7b5444cdd2dd1;p=sweep.git DOC: added section "Code Completion" to the manual --- diff --git a/NEWS.org b/NEWS.org index 26ddc7b..083e234 100644 --- a/NEWS.org +++ b/NEWS.org @@ -11,6 +11,15 @@ SWI-Prolog in Emacs. For further details, please consult the manual: . +* Version 0.8.1 on 2022-10-25 + +** Added completion-at-point for variable names + +When point is preceded by a valid Prolog variable name, invoking +~completion-at-point~ (with ~C-M-i~ or ~M-TAB~) now detects that it needs to +complete a variable name and provides other variable names that occur +in the same clause as completion candidates. + * Version 0.8.0 on 2022-10-22 ** New command ~sweeprolog-insert-term-dwim~ in ~sweeprolog-mode~ buffers diff --git a/README.org b/README.org index 904fbf7..2a8c852 100644 --- a/README.org +++ b/README.org @@ -895,6 +895,32 @@ the non-exported predicates defined in the current buffer. To force prompting for a predicate, invoke ~sweeprolog-export-predicate~ with a prefix argument (~C-u C-c C-e~). + +** Code Completion +:PROPERTIES: +:CUSTOM_ID: code-completion +:DESCRIPTION: Auto-completion commands for Prolog code +:END: + +#+CINDEX: code completion +#+CINDEX: completion-at-point +#+KINDEX: C-M-i +#+KINDEX: M-TAB +~sweeprolog-mode~ empowers Emacs's standard ~completion-at-point~ command, +bound by default to ~C-M-i~ and ~M-TAB~, with context-aware completion for +Prolog terms. For background about completion-at-point in Emacs, see [[info:emacs#Symbol +Completion][Symbol Completion in the Emacs manual]]. + +In ~sweeprolog-mode~ buffers, the following enhancements are provided: + +- Variable name completion :: If the text before point can be + completed to one or more variable names that appear elsewhere in the + current clause, ~completion-at-point~ suggests matching variable names + as completion candidates. +- Predicate completion :: If the text before point can be completed to + a predicate call, ~completion-at-point~ suggests matching predicates + as completion candidates. + ** Context-Based Term Insertion :PROPERTIES: :CUSTOM_ID: insert-term-at-point