Minor improvements to new Completion Preview commands
* lisp/completion-preview.el (Commentary): Mention
`completion-preview-partial-insert' and elaborate about
`completion-preview-insert-sexp'.
(completion-preview--barf-if-no-preview): New function.
(completion-preview-insert, completion-preview-complete):
Use it.
(completion-preview-partial-insert): Rename arg to FUN; only
compute (+ end (length aft)) once; bind 'deactivate-mark' to
nil while inserting/deleting to allow commands that use this
function to work as expected with 'shift-select-mode';
improve behavior when called with point not at the start of
the completion preview overlay (e.g. when point is in the
middle of a multi-word symbol and this function is called
via 'completion-preview-insert-word'); add the base part of
the completion candidate to when calling exit-function.
(completion-preview-insert-word): Improve docsting, rename
argument ARG to N.
(completion-preview-insert-sexp): Likewise, and also remove
second argument INTERACTIVE.
(completion-preview--active-p): Rename to...
(completion-preview-active-p): ...this. Make this function
public so users can leverage it for their own commands.
Extend docstring to explain how to do that.
* test/lisp/completion-preview-tests.el
(completion-preview-insert-calls-exit-function)
(completion-preview-insert-word): Break long lines.
(completion-preview-insert-sexp)
(completion-preview-insert-nonsubword)
(completion-preview-insert-subword): Fix docstrings.
(completion-preview-insert-mid-symbol): New test.
(cherry picked from commit
9cb2a2040888c28587bed2b0902d9da90720f9a0)