emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master de8cae30bcf: Add global minor mode 'global-completion-preview-mod


From: Eshel Yaron
Subject: master de8cae30bcf: Add global minor mode 'global-completion-preview-mode'
Date: Sun, 31 Mar 2024 03:33:18 -0400 (EDT)

branch: master
commit de8cae30bcf8283e4c3b069ccb8b75224659ac5c
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    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)
---
 doc/emacs/programs.texi    | 11 +++++++----
 etc/NEWS                   |  2 ++
 lisp/completion-preview.el |  4 ++++
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 1627e7e6cb7..de28a9f1dd4 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -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
diff --git a/etc/NEWS b/etc/NEWS
index 1204f58c5ca..775c8e02a95 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1559,6 +1559,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'.
 
 ---
 ** The highly accessible Modus themes collection has eight items.
diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el
index e827da43a08..6abdfed51a3 100644
--- a/lisp/completion-preview.el
+++ b/lisp/completion-preview.el
@@ -415,5 +415,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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]