1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

Add global minor mode 'global-completion-preview-mode'

This is a global variant of 'completion-preview-mode'.

* lisp/completion-preview.el (global-completion-preview-mode): New
global minor mode.

* doc/emacs/programs.texi (Symbol Completion): Document it.

* etc/NEWS: Announce it.  (Bug#70010)
This commit is contained in:
Eshel Yaron 2024-03-26 22:34:51 +01:00
parent 994bcc125b
commit de8cae30bc
No known key found for this signature in database
GPG key ID: EF3EE9CA35D78618
3 changed files with 13 additions and 4 deletions

View file

@ -1706,11 +1706,14 @@ based on the spell-checker's dictionary. @xref{Spelling}.
@cindex suggestion preview @cindex suggestion preview
@cindex Completion Preview mode @cindex Completion Preview mode
@findex completion-preview-mode @findex completion-preview-mode
@findex global-completion-preview-mode
Completion Preview mode is a minor mode that shows completion Completion Preview mode is a minor mode that shows completion
suggestions as you type. When you enable this mode (with @kbd{M-x suggestions as you type. You can enable it for the current buffer with
completion-preview-mode}), Emacs automatically displays the @kbd{M-x completion-preview-mode}, or globally with @w{@kbd{M-x
suggested completion for text around point as an in-line preview global-completion-preview-mode}}. When Completion Preview mode is on,
right after point; type @key{TAB} to accept the suggestion. Emacs automatically displays the suggested completion for text around
point as an in-line preview right after point; type @key{TAB} to accept
the suggestion.
@node MixedCase Words @node MixedCase Words
@section MixedCase Words @section MixedCase Words

View file

@ -1559,6 +1559,8 @@ sexp navigation more intuitive.
This minor mode shows you symbol completion suggestions as you type, This minor mode shows you symbol completion suggestions as you type,
using an inline preview. New user options in the 'completion-preview' using an inline preview. New user options in the 'completion-preview'
customization group control exactly when Emacs displays this preview. customization group control exactly when Emacs displays this preview.
'completion-preview-mode' is buffer-local, to enable it globally use
'global-completion-preview-mode'.
--- ---
** The highly accessible Modus themes collection has eight items. ** The highly accessible Modus themes collection has eight items.

View file

@ -415,5 +415,9 @@ cycles backward."
(remove-hook 'post-command-hook #'completion-preview--post-command t) (remove-hook 'post-command-hook #'completion-preview--post-command t)
(completion-preview-active-mode -1))) (completion-preview-active-mode -1)))
(define-globalized-minor-mode global-completion-preview-mode
completion-preview-mode completion-preview-mode
:predicate '((not minibuffer-mode special-mode) t))
(provide 'completion-preview) (provide 'completion-preview)
;;; completion-preview.el ends here ;;; completion-preview.el ends here