From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70010: 30.0.50; completion-preview-mode behaves mode-local, but is global Date: Wed, 27 Mar 2024 17:05:29 +0100 Message-ID: References: <87o7b1gsfp.fsf@posteo.net> <875xx8g4e8.fsf@posteo.net> <86msqjj2q2.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8757"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: philipk@posteo.net, 70010@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 27 17:06:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rpVn8-0001wr-Bj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Mar 2024 17:06:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpVmw-00048E-0P; Wed, 27 Mar 2024 12:06:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpVmt-000484-59 for bug-gnu-emacs@gnu.org; Wed, 27 Mar 2024 12:06:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpVms-0007Ra-GD for bug-gnu-emacs@gnu.org; Wed, 27 Mar 2024 12:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpVms-0005jy-9y for bug-gnu-emacs@gnu.org; Wed, 27 Mar 2024 12:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Mar 2024 16:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70010 X-GNU-PR-Package: emacs Original-Received: via spool by 70010-submit@debbugs.gnu.org id=B70010.171155553821965 (code B ref 70010); Wed, 27 Mar 2024 16:06:02 +0000 Original-Received: (at 70010) by debbugs.gnu.org; 27 Mar 2024 16:05:38 +0000 Original-Received: from localhost ([127.0.0.1]:38232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpVmU-0005iC-Bq for submit@debbugs.gnu.org; Wed, 27 Mar 2024 12:05:38 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:58138 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpVmP-0005i1-5l for 70010@debbugs.gnu.org; Wed, 27 Mar 2024 12:05:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1711555532; bh=5CZleGrZHCnZrH9gm9Mj1wkoT7aIijORTJbAshXEuCQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=I9RWA0I/LJNn9mVc8zcK9ctxHVEPQZlAGr/Kcj3ks9Zb84d1Rv3jinCaD2dRpUlJl rBVdNy6fnr3M6i9IVg7pM5ee47XWr6Mhw7uNdHGj3cTTgj+JcY8wazh+sYvizMTVHj K2Y1OyQIYsnAwCeBUcr72fM0oIX/C9l8LyFJeohqFfTcOud0f4g5g6dj4AF4l2e7DU YaIlWsjYoqXt8P0tB5RmuALBFjmyLQlxVC1cIy5BgAf2k92lMRTojYRFRNwp0o39sM 2dm908SwDTMHGRNXRVaTbJS1SlEIifeBxYrm40W4MCFvbJceD3xrENGM8y1wPYxf/I Sa8qeBoKtiMgA== In-Reply-To: <86msqjj2q2.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Mar 2024 14:09:25 +0200") X-Hashcash: 1:20:240327:eliz@gnu.org::HbghKVuHoIlShJMG:09ii X-Hashcash: 1:20:240327:philipk@posteo.net::WlkC9dNuUFekXU12:suG X-Hashcash: 1:20:240327:70010@debbugs.gnu.org::fmTT7XGLPAjeHzz8:42am X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282145 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Thanks, but please add a NEWS entry announcing this, and also mention > this variant in the user manual, where completion-preview-mode is > documented. All right, I'm attaching an updated patch below. Since 'completion-preview-mode' is new in Emacs 30, I extended the existing NEWS entry with a mention of the global variant, instead of adding another entry. I've also renamed the global variant per Juri's comment: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=v2-0001-Add-global-minor-mode-global-completion-preview-m.patch >From 828544ab372d5e7731772b9854732c9373497903 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Tue, 26 Mar 2024 22:34:51 +0100 Subject: [PATCH v2] 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 @@ Symbol Completion @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 60fe75fc340..906bf5a9c3c 100644 --- 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'. diff --git a/lisp/completion-preview.el b/lisp/completion-preview.el index 75386f96429..c9f3a81b879 100644 --- a/lisp/completion-preview.el +++ b/lisp/completion-preview.el @@ -414,5 +414,9 @@ completion-preview-mode (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 -- 2.44.0 --=-=-=--