From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#70010: 30.0.50; completion-preview-mode behaves mode-local, but is global Date: Tue, 26 Mar 2024 19:49:19 +0000 Message-ID: <875xx8g4e8.fsf@posteo.net> References: <87o7b1gsfp.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8009"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70010@debbugs.gnu.org To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 26 20:50:28 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 1rpCoW-0001qO-61 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Mar 2024 20:50:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpCoB-0000QI-SD; Tue, 26 Mar 2024 15:50:08 -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 1rpCo6-0000Q1-SK for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2024 15:50:02 -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 1rpCo6-0001FS-Js for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2024 15:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpCo6-0003WK-70 for bug-gnu-emacs@gnu.org; Tue, 26 Mar 2024 15:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Mar 2024 19:50: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.171148257113448 (code B ref 70010); Tue, 26 Mar 2024 19:50:02 +0000 Original-Received: (at 70010) by debbugs.gnu.org; 26 Mar 2024 19:49:31 +0000 Original-Received: from localhost ([127.0.0.1]:35109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpCna-0003Uq-Of for submit@debbugs.gnu.org; Tue, 26 Mar 2024 15:49:31 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:50821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpCnX-0003Tf-J6 for 70010@debbugs.gnu.org; Tue, 26 Mar 2024 15:49:29 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 17618240103 for <70010@debbugs.gnu.org>; Tue, 26 Mar 2024 20:49:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1711482561; bh=hc//1Yu+Rub8gvWEl6LYJ0yZzlnbAWtVe+gJUSq904U=; h=From:To:Cc:Subject:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=gjKYVnHcWDloERVXEX4w2maD7p8734nxMkPy1m9krrL/0wdqaWS6fJooZtCQR3HHv TQhIcCexgDJz3GH0q2V6c7dVwkfTZhVAOP5mfMiBHYCMfkEkdOnzHAcS9yHIs6MAg5 TxBSlNiESXkOp/9dHbVmFN8vhZEJpMndPd57mx7bWGWum1010XN+Aqu/D0hj7mN+aj vhV84EejQmD7rTWYDbvLvnSotnjbeEKabMmjGaZB76El51kaN70Lo9RmvlnvCAZRAQ l5TnMVd3n5qTXKPqDBPR9wOaIwu1yYbjq0XDKN66QW9HaWdIwoLq9b4hYhjRqktLPV uiWwwptHD0lkA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4V40k82GrLz6tyQ; Tue, 26 Mar 2024 20:49:20 +0100 (CET) In-Reply-To: (Eshel Yaron's message of "Tue, 26 Mar 2024 20:10:28 +0100") OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66; url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66"; preference=signencrypt 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:282110 Archived-At: Eshel Yaron writes: > Hello Philip, > > Philip Kaludercic writes: > >> I tried to enable `completion-preview-mode' by adding >> >> (setopt completion-preview-mode t) >> >> in my init, but it had not effect. > > Indeed, it is a minor mode, so one normally enables it by calling the > function completion-preview-mode, perhaps interactively via M-x. I enable all minor modes as user options, so I'd disagree that using a function or invoking the command are the only ways to expect a minor mode to be enabled. >> When I check the implementation, I noticed that it modifies >> `post-command-hook' locally. I think it would make sense to rename >> the current `completion-preview-mode' to >> `completion-preview-local-mode', and then use >> `define-globalized-minor-mode' to define `completion-preview-mode'. > > We can add a global variant, although IMO the natural scope for > completion-preview-mode is per major mode: for some kinds of content you > want to have completion preview, and for others you may want it off. > Note that a necessary condition for completion-preview-mode to be useful > in a certain context is that completion-at-point is useful in that > context, since otherwise there's nothing to preview. > > Therefore, I recommend enabling completion-preview-mode by adding it to > major mode hooks, such as prog-mode-hook or comint-mode-hook. > Admittedly, if you do want to enable it for all buffers, the major mode > hook approach would require adding it to four or five hooks, which is a > bit less elegant than enabling a global minor mode once. > > So I suggest we keep completion-preview-mode local and add a global > variant, say, completion-preview-global-mode, for enabling it globally. > WDYT? That seems fine as well. -- Philip Kaludercic on peregrine