]> git.eshelyaron.com Git - emacs.git/commitdiff
Add global minor mode 'global-completion-preview-mode'
authorEshel Yaron <me@eshelyaron.com>
Tue, 26 Mar 2024 21:34:51 +0000 (22:34 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 27 Mar 2024 15:57:55 +0000 (16:57 +0100)
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)

doc/emacs/programs.texi
etc/NEWS
lisp/completion-preview.el

index 1627e7e6cb7789ad7d66320223808744d87d5fa3..de28a9f1dd4f24fbe289733797a7c932e2134687 100644 (file)
@@ -1706,11 +1706,14 @@ based on the spell-checker's dictionary.  @xref{Spelling}.
 @cindex suggestion preview
 @cindex Completion Preview mode
 @findex completion-preview-mode
+@findex global-completion-preview-mode
   Completion Preview mode is a minor mode that shows completion
-suggestions as you type.  When you enable this mode (with @kbd{M-x
-completion-preview-mode}), 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.
+suggestions as you type.  You can enable it for the current buffer with
+@kbd{M-x completion-preview-mode}, or globally with @w{@kbd{M-x
+global-completion-preview-mode}}.  When Completion Preview mode is on,
+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
 @section MixedCase Words
index 60fe75fc34077b8638896164cf5dcdd5cbbd37b1..906bf5a9c3cecbcb45db2a22337926a0f69960c5 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1644,6 +1644,8 @@ sexp navigation more intuitive.
 This minor mode shows you symbol completion suggestions as you type,
 using an inline preview.  New user options in the 'completion-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'.
 
 +++
 *** New user option 'extended-command-dim-hyphens'.
index 75386f9642987952e4eee0061e224aff784f8860..c9f3a81b87968013ef9cf55c77d8449a22b80a18 100644 (file)
@@ -414,5 +414,9 @@ cycles backward."
     (remove-hook 'post-command-hook #'completion-preview--post-command t)
     (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)
 ;;; completion-preview.el ends here